[R] Call R from C

Steve Lianoglou mailinglist.honeypot at gmail.com
Tue Feb 21 00:37:48 CET 2012


Hi,

On Mon, Feb 20, 2012 at 6:15 PM, nitin kumar <nitbio at gmail.com> wrote:
> Dear All,
>
> I am new to calling R in C.
>
> I want to call sample R function in C. i.e. I want to do a sample
> equivalent to
>
> n <- c(1:10)
> p <- seq(0,10,length.out= 10)
>
> sample(n,size = 1, prob = p, replace = FALSE)
>
> how can I call this function directly in C?

Perhaps the RInside package can help?

http://cran.r-project.org/web/packages/RInside/index.html
http://dirk.eddelbuettel.com/code/rinside.html

HTH,
-steve

-- 
Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact



More information about the R-help mailing list