Message-ID: <19918.64032.610545.559988@max.nulle.part>
Date: 2011-05-14T21:54:40Z
From: Dirk Eddelbuettel
Subject: [Rcpp-devel] Rcpp equivalent of sample()?
In-Reply-To: <BANLkTinFEszGQcNr-7uKMbSb5Gu4XPdU3Q@mail.gmail.com>
On 14 May 2011 at 14:11, Chris DuBois wrote:
| 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).
No, sorry, I think you'd have to write a local version.
Dirk
--
Gauss once played himself in a zero-sum game and won $50.
-- #11 at http://www.gaussfacts.com