[Rcpp-devel] Rcpp version of DATAPTR

Whit Armstrong armstrong.whit at gmail.com
Wed Apr 11 20:16:28 CEST 2012


I've been looking in the archives of this list for a while, so forgive
me if I've missed it.

Does Rcpp expose a version of the DATAPTR macro?

Sadly, I have a need for a void* in my code...  So I need a very old
school C way of accessing the raw memory referenced by an SEXP.

I tried to use RAW(), but the version of RAW exposed when using Rcpp
is from memory.c, which wraps all the calls w/ checks like this:
    if(TYPEOF(x) != RAWSXP)
	error("%s() can only be applied to a '%s', not a '%s'",
	      "RAW", "raw", type2char(TYPEOF(x)));

Thanks,
Whit


More information about the Rcpp-devel mailing list