[R] Rcpp, dyn.load and C++ problems

Dirk Eddelbuettel edd at debian.org
Sun Dec 3 20:33:18 CET 2017


On 3 December 2017 at 11:08, Peter Langfelder wrote:
| I would go to the source, in this case Dirk Eddelbuettel's (I hope I
| spelled it correctly)

You did. Take a point :)

| documentation for Rcpp:
| 
| http://dirk.eddelbuettel.com/code/rcpp/Rcpp-attributes.pdf

Yup.  And

    RShowDoc("Rcpp-attributes", package="Rcpp")

in R is even easier.

On 3 December 2017 at 13:19, Dirk Eddelbuettel wrote:
| 0) Wrong list. Rcpp has its down, rcpp-devel, and I basically do not read
| this and would have missed this were it not for luck.

"R has its own list, rcpp-devel" is what I meant to write.  For completeness,
we can also test on the command-line as Martin and what I do a lot myself:

edd at bud:~$ r -lRcpp -e'sourceCpp("/tmp/mmsp.cpp")'

R> res <- compute_values_cpp()

R> str(res)

Attaching package: ‘utils’

The following objects are masked from ‘package:Rcpp’:

    .DollarNames, prompt

List of 2
 $ x: num [1:100000] 199 362 118 302 262 ...
 $ y: num [1:100000] 20 40 14.3 39.5 36.9 ...
You have mail in /var/mail/edd
edd at bud:~$


That uses littler which I like, Rscript is almost the same (but has no -l
switch for libraries and fails to load the methods package which we sometimes
need).

Dirk


-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org



More information about the R-help mailing list