Displaying 1 result from an estimated 1 matches for "jl_main_module".
2014 Jun 24
2
using C code to create data frame but always return as list
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 Frame cols
sprintf(evalcmd,"size(%s,2)",dfname);
jl_value_t* cols=jl_eval_string(evalcmd);
int collen=jl_unbox_long(cols);
jl_value_t* eachcolvector;
//Create VECSXP
//Create SEXP for Each Column and assign
PROTECT(ans=allocVector(VEC...