[R] a question about writing C extensions to functions
    Uwe Ligges 
    ligges at statistik.tu-dortmund.de
       
    Sun Mar 18 15:43:06 CET 2012
    
    
  
On 16.03.2012 18:08, Erin Hodgess wrote:
> Dear R People:
>
> I'm not sure if I should ask this here or in Rcpp,
Why is this related to Rcpp?
> but I thought I'd
> start here first.
>
> If I'm writing a C program, when do I know to use SEXP vs. int or float, please?
For very short:
If you want keep some things internal to your C code, use int etc. , but 
if it makes sense to use R objects (e.g. because you return things or 
make use of otehr R functionality), use SEXP objects. If the latter, you 
already decided to use the .Call() interface.
There is more in Writing R Extensions.
Uwe
> Thanks,
> Erin
>
>
    
    
More information about the R-help
mailing list