[Rcpp-devel] Rcpp equivalent of sample()?

Chris DuBois chris.dubois at gmail.com
Sat May 14 23:11:47 CEST 2011

Hi all,

I'm just getting my feet wet with some Rcpp.  I'm comfortable with R but new
to C++.  In the Rcpp vignettes, I found some of the R-like functions for
sampling from distributions (runif, rnorm, etc), but I didn't see a function
mimicking sample(). I checked the list of unit tests and didn't see it there
either.  Have I missed it?  Is there a C++ function I should be using to
sample (with replacement in my particular situation) from a vector (with
provided weights).

Thanks for any pointers,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20110514/09b7779b/attachment.htm>

More information about the Rcpp-devel mailing list