[Rcpp-devel] is<T>( SEXP )

Hadley Wickham h.wickham at gmail.com
Thu Jul 18 13:32:07 CEST 2013


> I've just commited some code that will help us identify if a given R object
> (a SEXP) can be seen as a given c++ type (e.g. IntegerVector, etc ...)
>
> Works like this:
>
> SEXP x ; // a SEXP from somewhere, or an RObject
> is<IntegerVector>( x ) ;
> is<int>( x ) ;
> is<DataFrame>( x ) ;

Nice!

Combining this with attribute support would be awesome.

Hadley

--
Chief Scientist, RStudio
http://had.co.nz/


More information about the Rcpp-devel mailing list