[Rcpp-devel] Help with an Rcpp and CppBugs example

Shige Song shigesong at gmail.com
Sat Oct 1 03:40:36 CEST 2011


Dear Dirk,

Thank you very much for the suggestions and the upated file. Your file
actually works flawlessly on my system. It looks really interesting
and educational.

Thanks also for the great work on Rcpp, really amazing piece of
software you got there.

Best,
Shige

On Fri, Sep 30, 2011 at 9:11 PM, Dirk Eddelbuettel <edd at debian.org> wrote:
>
> Shige,
>
> There is no way to sugarcoat this: you have to learn to live with, and learn
> from, the compiler errors and relate them to the actual code. Using Rcpp
> still means programming in the context of a C++ compiler.
>
>
> You also need Whit's CppBugs repo from github _installed somewhere_ so that
>
>  #include <cppbugs/cppbugs.hpp>
>
> works. Plus the same for Conrad's Armadillo as we have
>
>  #include <armadillo>
>
> And to top it all off, you probably need a bunch of Boost installed as
> CppBugs uses it.  If all that is a given, then you can run the attached file
> 'whit.r' as I do below. This file served as in example in the Rcpp workshop
> in April and I just fetched it from my sources. The version posted then is
> likely a little outdated.  But this one works:
>
> $ r whit.R
> Loading required package: methods
>   user  system elapsed
>  0.220   0.020   0.236
> $b
> [1] -0.3303790  0.5276294
>
> $ar
> [1] 0
>
> $
>
> Whether you use Rscript or r (from littler) does not matter.  The updated
> whit.r is attached.  It builds and runs, I have no idea if it makes any
> sense... I think it regresses y ~ X with both being noise so there.
>
> Hope this helps,  Dirk
>
>
>
>
> --
> New Rcpp master class for R and C++ integration is scheduled for
> San Francisco (Oct 8), more details / reg.info available at
> http://www.revolutionanalytics.com/products/training/public/rcpp-master-class.php
>
>


More information about the Rcpp-devel mailing list