Blog Archives

Coping with varying `gcc` versions and capabilities in R packages

June 29, 2019
By

The problem I have a package called strex which is for string manipulation. In this package, I want to take advantage of the regex capabilities of C++11. The reason for this is that in strex, I find myself needing to do a calculation like x ] #__ 1e+03 2e+06 #__ #__ ] #__ 1 50 3455 A...

Read more »

Using R’s set.seed() to set seeds for use in C/C++ (including Rcpp)

September 29, 2018
By

In native R, the user sets the seed for random number generation (RNG) with set.seed(). Random number generators exist in C and C++ too; these need their own seeds, which are not obviously settable by set.seed(). Good news! It can be done. pacman::p_load(inline, purrr) rbernoulli Base R (or technically the stats package) provides no rbernoulli(). It’s a pretty gaping hole in the...

Read more »

Search R-bloggers

Sponsors

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)