Re: [Rd] using 2D array of SEXP for creating dataframe

2014-06-27 Thread Sandip Nandi
Thanks a lot . Appreciate your time . I am sorry for missing snippets of the code , trying to copy back and forth . My bad .sorry for that . The dataframe df is to be of VECSXP . PROTECT(df = allocVector(VECSXP,2)); What I am trying to do ? Lets say you read a huge table , with each column is d

Re: [Rd] using 2D array of SEXP for creating dataframe

2014-06-26 Thread Hervé Pagès
On 06/26/2014 05:18 PM, Sandip Nandi wrote: Hi , I have asked a question , whether the data structure I am using to create a dataframe is fine or there is anyother way i can use. My aim is to read a database and write it to dataframe and do operation on it . The dataframe creation ,output every

Re: [Rd] using 2D array of SEXP for creating dataframe

2014-06-26 Thread Sandip Nandi
Hi , I have asked a question , whether the data structure I am using to create a dataframe is fine or there is anyother way i can use. My aim is to read a database and write it to dataframe and do operation on it . The dataframe creation ,output everything works . The code I put is wrong , tryin

Re: [Rd] using 2D array of SEXP for creating dataframe

2014-06-26 Thread Hervé Pagès
Hi Sandip, On 06/26/2014 04:21 PM, Sandip Nandi wrote: Hi , I have put incomplete code here . The complete code works , My doubt is , what I am doing logical/safe ? Any memory leak going to happen ? is there any way to create dataframe ? I still don't believe it "works". It doesn't even compi

Re: [Rd] using 2D array of SEXP for creating dataframe

2014-06-26 Thread Sandip Nandi
Hi , I have put incomplete code here . The complete code works , My doubt is , what I am doing logical/safe ? Any memory leak going to happen ? is there any way to create dataframe ? SEXP formDF() { SEXP dfm ,head,df , dfint , dfStr,lsnm; SEXP valueVector[2]; char *ab[3] = {"aa","vv","gy"}; i

Re: [Rd] using 2D array of SEXP for creating dataframe

2014-06-26 Thread Hervé Pagès
Hi, On 06/26/2014 02:32 PM, Sandip Nandi wrote: Hi , For our production package i need to create a dataframein C . So I wrote the following code SEXP dfm ,head,df , dfint , dfStr,lsnm; *SEXP valueVector[2];* char *ab[3] = {"aa","vv","gy"}; int sn[3] ={99,89,12}; char *listnames[2] = {"int",

[Rd] using 2D array of SEXP for creating dataframe

2014-06-26 Thread Sandip Nandi
Hi , For our production package i need to create a dataframein C . So I wrote the following code SEXP dfm ,head,df , dfint , dfStr,lsnm; *SEXP valueVector[2];* char *ab[3] = {"aa","vv","gy"}; int sn[3] ={99,89,12}; char *listnames[2] = {"int","string"}; int i,j; //