Created
February 8, 2013 00:57
-
-
Save kevinushey/4735701 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Rcpp.h> | |
using namespace Rcpp; | |
// [[Rcpp::export]] | |
StringVector check( StringVector x ) { | |
Rcout << "The type of x is: " << ::TYPEOF( x ) << std::endl; | |
Rcout << "The type of x(0) is: " << ::TYPEOF( x(0) ) << std::endl; | |
Rcout << "The integer associated with STRSXPs is: " << STRSXP << std::endl; | |
Rcout << "The integer associated with CHARSXPs is: " << CHARSXP << std::endl; | |
Rcout << "Is x a string?: " << ::Rf_isString(x) << std::endl; | |
Rcout << "Is x(0) a string?: " << ::Rf_isString(x(0)) << std::endl; | |
return x; | |
} | |
/*** R | |
check( c("a", "b", "c") ) | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment