Something like
#include <Rcpp.h>
using namespace Rcpp;
// [[Rcpp::export]]
CharacterVector foo() {
Function opt("getOption");
CharacterVector x = opt("digits");
return x;
}
/*** R
foo()
*/
> foo()
[1] "7"
- all though the result is here a character.
Regards
Søren
From: [email protected]
[mailto:[email protected]] On Behalf Of Rguy
Sent: 1. august 2015 08:07
To: Rcpp
Subject: [Rcpp-devel] Getting an R option in Rcpp
Can I access an R option from within an Rcpp function? I'd like the access to
happen at runtime, not at compile time. Something like this:
if (getOption("my_option") == x) {
do this;
} else {
do that;
}
_______________________________________________
Rcpp-devel mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel