Hi , I am trying to implement the following from C
> x a b 1 1 2 2 3 4 r<- head(x,n=1) > r a b 1 1 2 I tried my code , its not working , its not working for the value of the parameter n Thanks, Sandip On Thu, Jun 26, 2014 at 12:50 AM, Simon Urbanek <simon.urba...@r-project.org > wrote: > On Jun 25, 2014, at 11:31 PM, Sandip Nandi <sanna...@umail.iu.edu> wrote: > > > Hi , > > > > I am trying to call head function from C . My doubt is with the parameter > > n,how to pass it . > > > > PROTECT(dfm=lang3(install("data.frame"),df,ScalarLogical(FALSE))); > > SET_TAG(CDDR(dfm), install("stringsAsFactors")) ; > > SEXP res = PROTECT(eval(dfm,R_GlobalEnv)); > > PROTECT(head=lang3(install("head"),res,ScalarInteger(1))); > > head = PROTECT(eval(head,R_GlobalEnv)); > > > > > > I tried the above following , it seemed to be not working . Can you > please > > help. > > > > Can you elaborate? The above code works AFAICT ... > > Cheers, > S > > > > > Thanks > > > > [[alternative HTML version deleted]] > > > > ______________________________________________ > > R-devel@r-project.org mailing list > > https://stat.ethz.ch/mailman/listinfo/r-devel > > > > [[alternative HTML version deleted]] ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel