Is there a general way of passing a data frame with arbitrary columns (integer/factor, numeric, character data) from r to c and back? Pointers to close enough examples would be greatly appreciated.
Thanks.
RT
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A data.frame is a list, so along the lines of
and then after
R CMD SHLIB df_fun.cUse
GET_CLASS,GET_ATTRand other macros in Rdefines.h (or their equivalent functions, likegetAttrib) to discover other information about the data frame. Note though that a data.frame has an API that can differ from its structure. So for instance the R functionrow.namescan return something different from the value stored in the row.names attribute. I think most.Callfunctions operate on atomic vectors, keeping the manipulation of more complicated objects at the R level.