[Rd] using C code to create data frame but always return as list

2014-06-24 Thread Yu Gong
there is my code,  expect return value  is a data frame but R say it is list: SEXP Julia_R_MD_NA_DataFrame(jl_value_t* Var) {  SEXP ans,names,rownames;  char evalcmd[4096];  int i;  const char* dfname=DataFrameName0tmp;  jl_set_global(jl_main_module, jl_symbol(dfname), (jl_value_t*)Var);  //Get

Re: [Rd] using C code to create data frame but always return as list

2014-06-24 Thread Romain Francois
Hi, Can you give us what str on the returned object gives you? I think you need : SET_OBJECT(and, 1) ; at the end. Romain Le 24 juin 2014 à 08:57, Yu Gong armg...@yahoo.com a écrit : there is my code, expect return value is a data frame but R say it is list: SEXP

Re: [Rd] using C code to create data frame but always return as list

2014-06-24 Thread Simon Urbanek
On Jun 24, 2014, at 9:21 AM, Romain Francois rom...@r-enthusiasts.com wrote: Hi, Can you give us what str on the returned object gives you? I think you need : SET_OBJECT(and, 1) ; at the end. SET_OBJECT should not be used by user code in normal circumstances, it is set by R