我想在Rcpp中获得一个选项(例如"width"
)的值。我试过了:
#include <Rcpp.h>
using namespace Rcpp;
// [[Rcpp::export]]
int test_option() {
Environment base("package:base");
Function get_option = base["getOption"];
return get_option("width");
}
// [[Rcpp::export]]
int test_option2() {
Environment base("package:base");
Function get_option = base["options"];
List l_width = get_option("width");
return l_width[1];
}
第一个函数没有编译,第二个函数使会话崩溃。
你知道怎么做吗?
https://stackoverflow.com/questions/51236092
复制相似问题