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

Re: [Rd] inconsistent error messages on Mac OS X

2014-04-02 Thread Dan Tenenbaum
- Original Message - > From: "Adam Welc" > To: r-devel@r-project.org > Sent: Wednesday, April 2, 2014 3:11:28 PM > Subject: [Rd] inconsistent error messages on Mac OS X > > Hi All, > > I am one of the contributors to the FastR project ( > https://bitbucket.org/allr

[Rd] inconsistent error messages on Mac OS X

2014-04-02 Thread Adam Welc
Hi All, I am one of the contributors to the FastR project ( https://bitbucket.org/allr ) and I have encountered an interesting issue when trying to implement vector accesses within FastR. I am trying to understand what kind of error message should be generated for the

Re: [Rd] Typeof for character vector in dataframe returns integer

2014-04-02 Thread Joris Meys
I know a few good books where this is explained. This free one for example: http://cran.r-project.org/doc/manuals/R-intro.pdf chapters 4 and 6. Or http://rfordummies.com/ if you insist on paying for it. PS: Jeff, R is not C. different place in the alphabet and all... On Wed, Apr 2, 2014 at 2:5

Re: [Rd] Typeof for character vector in dataframe returns integer

2014-04-02 Thread Jeff Johnson
Perhaps because indexes start at 0? Sent from my iPhone > On Apr 1, 2014, at 5:46 PM, Sandip Nandi wrote: > > Hi , > > I want to know is this behavior expected and why is that ? Need some help > > gender <- c("F", "M", "M", "F", "F", "M", "F", "F") >> age<- c(23, 25, 27, 29, 31, 33, 35, 3

Re: [Rd] Typeof for character vector in dataframe returns integer

2014-04-02 Thread Martin Maechler
PLEASE! All this does *not* belong to the R-devel mailing list. It is entirely apt for R-help (or "similar", including stackoverflow). Please do *not* misuse R-devel for basic R questions. Martin Maechler, ETH Zurich __ R-devel@r-project.org mailing