Re: [Rd] question regarding lang2 command in C

2014-04-02 Thread Romain François
Hi, This is easy if the gender and age are already vectors of some sort of the same size. SEXP df = PROTECT(allocVector(VECSXP, 2)); SET_VECTOR_ELT(df,0,gender) ; SET_VECTOR_ELT(df,1,age) ; SEXP names = PROTECT(allocVector(STRSXP,2)); SET_STRING_ELT(names,0,mkChar("age")) SET_STRING_ELT(names

[Rd] question regarding lang2 command in C

2014-04-02 Thread Sandip Nandi
Hi , I am asking too many questions , sorry for that . I am creating a data frame in C itself , reading a table . The data frame calling code looks like this == *PROTECT(dfm=lang2(install("data.frame"),df));* *SEXP res = PROTECT(eval(dfm,R_GlobalEnv));* UNPR