Re: [R] where is internal function of sample()?

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Tue 12 Apr 2005 - 16:46:05 EST

On Mon, 11 Apr 2005, Weijie Cai wrote:

> I am trying to write a c++ shared library for R. I need a function which has
> the same functionality as sample() in R, i.e., does permutation, sample
> with/without replacement. Does R have internal sample routine so that I can
> call it directly?
>
> I did not find it in R.h, Rinternal.h.

That's because it is not in the API. The function is do_sample in src/main/random.c. You could construct an appropriate call with some ingenuity.

Please note that R-devel is the list for C-level programming questions, as the posting guide points out.

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Tue Apr 12 16:55:51 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:07 EST