[R] Returning a dataframe from a C function (How) ?

Neil Osborne r_stuff_online at hotmail.com
Thu May 2 14:36:44 CEST 2002


I'm writing an R extension. The language I'm using is ANSI C. One of the 
functions I'm writing will accept a string and return a dataset as a 
dataframe. i.e the prototype will be of the form:

dataframe foo(R_String)
{
}


Does anyone have any skeleton code for such a function, i.e. one that 
receives an R "string" and returns a dataset as a dataframe ?

The main concerns I have are:

1. Handling the "R_String" in C (i.e. converting it into a char*)
2. Creating an R dataframe in C


Any help will be very much appreciated (and yes, I have read "Writing R 
extensions")


Many thanks in advance

_________________________________________________________________


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list