To olhando o exemplo abaixo:

     void convolve(double *a, int *na, double *b, int *nb, double *ab)
     {
         R_len_t i, j, nab = *na + *nb - 1;
     
         for(i = 0; i < nab; i++)
             ab[i] = 0.0;
         for(i = 0; i < *na; i++)
             for(j = 0; j < *nb; j++)
                 ab[i + j] += a[i] * b[j];
     }

called from R by

     conv <- function(a, b)
         .C("convolve",
            as.double(a),
            as.integer(length(a)),
            as.double(b),
            as.integer(length(b)),
            ab = double(length(a) + length(b) - 1))$ab
Não estou conseguindo rodar. Devo gerar um arquivo .o ou o R tem algum compilador por trás para ler o código? Estou perdido :(

Pedro

Em 25 de agosto de 2011 10:39, beniltoncarvalho [via R-br] <ml-node+3768249-113061051-223914@n4.nabble.com> escreveu:
Procure pelo thread chamado: "Pacotes e C, Fortran ou outros".
_______________________________________________
R-br mailing list
[hidden email]
https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br
Leia o guia de postagem (http://www.leg.ufpr.br/r-br-guia) e forneça código mínimo reproduzível.



If you reply to this email, your message will be added to the discussion below:
http://r-br.2285057.n4.nabble.com/R-br-Duvida-Invocar-funcoes-C-no-R-tp3768159p3768249.html
To unsubscribe from R-br, click here.



--
Saudações,
Pedro Rafael Diniz Marinho - Estatístico SES-PB
Currículo Lattes: http://buscatextual.cnpq.br/buscatextual/visualizacv.jsp?id=K4250792T6