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))$abNã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 :(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.
http://r-br.2285057.n4.nabble.com/R-br-Duvida-Invocar-funcoes-C-no-R-tp3768159p3768249.htmlIf you reply to this email, your message will be added to the discussion below:To unsubscribe from R-br, click here.