g
> Subject: Re: [R] pass an element in a list() from R to C
>
> so, I did this:
>
> B= list("a" = 1, "b" = 2, "c" = 3)
>
> .C("myfunction", B)
>
>
> the c code is :
>
> SEXP myfunction(SEXP matrix_temp)
> {
>
so, I did this:
B= list("a" = 1, "b" = 2, "c" = 3)
.C("myfunction", B)
the c code is :
SEXP myfunction(SEXP matrix_temp)
{
Rprintf("this element is %6.3f", REAL(VECTOR_ELT(matrix_temp,1))[0]);
}
but after runing the R code, it says Error: VECTOR_ELT() can only be applied
to a 'list', not
2 matches
Mail list logo