[Rcpp-devel] Favourite Rcpp examples for newbies ?

French, Joshua JOSHUA.FRENCH at UCDENVER.EDU
Thu Aug 1 18:08:15 CEST 2013


Dirk,

Piggybacking off of Jonathan's suggestion, attached are the slides and code for a talk on Bayesian Data Analysis at the Denver R User's Group (DRUG) in April.  In the talk, I used the inline package and Rcpp to speed up MCMC sampling.

I use the famous coal mining accidents data set and try to determine the year in which safety standards changed the typical number of coal mining accidents.  The relevant files are drug_first.R (a naïve implementation in R), drug_vec.R (a vectorized R version that speeds things up quite a bit, and drug_rcpp.R (the inline Rcpp version).  The advantage of this example is that it uses real data, and you could probably do a couple of cool plots using ggplot2 to backup the other speaker.  The Rcpp version could be improved with the recent enhancements to Rcpp.

Joshua
--
Joshua French, Ph.D.
Assistant Professor
Department of Mathematical and Statistical Sciences
University of Colorado Denver
Joshua.French at ucdenver.edu<mailto:Joshua.French at ucdenver.edu>
http://math.ucdenver.edu/~jfrench/
Ph:  303-556-6253  Fax:  303-556-8550
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130801/a67a372a/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DRUG_Bayesian_in_R.pdf
Type: application/pdf
Size: 3672776 bytes
Desc: DRUG_Bayesian_in_R.pdf
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130801/a67a372a/attachment-0001.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DRUG_BDA_in_R_Code.zip
Type: application/zip
Size: 8588 bytes
Desc: DRUG_BDA_in_R_Code.zip
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130801/a67a372a/attachment-0001.zip>


More information about the Rcpp-devel mailing list