[Rcpp-devel] Sample function(s) for inclusion in RcppArmadillo

Christian Gunning xian at unm.edu
Sat Apr 13 03:38:18 CEST 2013


Johnathan,

Thanks for formatting this, it looks great.  I've added the case of
without replacement, and a brief discussion of Walker's alias (that
depends on the SVN version of RcppArmadillo, r4296), confirmed that it
works with a local install of jekyll, and pushed it back to your
github repo. Can you deal with it from here?

I think this is long enough for a single post, and that it should get
published whenever the next version of RcppArmadillo comes out.

One minor issue with jekyll or markup (??) that someone else can
hopefully comment on:
The following R code produces a warning that contains a < sign and
leads to an error in the rendered webpage.

## R code
n.elem <- 1e3
r.prob <- sample(1:n.elem, n.elem, prob = runif(n.elem), replace = T)

Error:
REXML could not parse this XML/HTML:
<pre class="output">
Warning: Walker's alias method used: results are different from R < 2.2.0
</pre>


best,
Christian

On Fri, Mar 29, 2013 at 4:42 PM, Dirk Eddelbuettel <edd at debian.org> wrote:
>
> On 29 March 2013 at 18:43, Jonathan Olmsted wrote:
> | Yup. Progress was waiting on finalizing behavior of sample().
> |
> | Current status is visible here: https://github.com/olmjo/rcpp-gallery/blob/
> | gh-pages/src/2013-03-19-using-the-Rcpp-based-sample-implementation.Rmd
>
> Awesome :)
>
> Will check this later unless I forget.
>
> Dirk
>
> --
> Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com
>
>



--
A man, a plan, a cat, a ham, a yak, a yam, a hat, a canal – Panama!


More information about the Rcpp-devel mailing list