Here you will find daily news and tutorials about R, contributed by over 750 bloggers.
There are many ways to follow us - By e-mail:On Facebook: If you are an R blogger yourself you are invited to add your own R content feed to this site (Non-English R bloggers should add themselves- here)

Needed to generate draws from an inverse Gaussian today, so I wrote the following Rcpp code:

#include
// [[Rcpp::depends(RcppArmadillo)]]
using namespace Rcpp;
using namespace arma;
// [[Rcpp::export]]
Col rrinvgauss(int n, double mu, double lambda){
Col random_vector(n);
double z,y,x,u;
for(int i=0; i

It seems to be faster than existing implementations such as rig from mgcv and rinvgauss from statmod packages.