From simon.urbanek at r-project.org  Thu Jun 26 09:50:54 2014
From: simon.urbanek at r-project.org (Simon Urbanek)
Date: Thu, 26 Jun 2014 09:50:54 +0200
Subject: [Rd] Need help on calling Head from C
In-Reply-To: <CAGSjAUC2q3s19Bx4Vs7TJuw2y8aF9Xwn0MBwfbV0wn17TPfZoA@mail.gmail.com>
References: <CAGSjAUC2q3s19Bx4Vs7TJuw2y8aF9Xwn0MBwfbV0wn17TPfZoA@mail.gmail.com>
Message-ID: <B20A88CC-F4B3-4DE5-9109-C95C30469AB9@r-project.org>

On Jun 25, 2014, at 11:31 PM, Sandip Nandi <sannandi at 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 at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



[Rd] Need help on calling Head from C
Simon Urbanek