I am using a truely wonderfull package Rcpp to pass my C++ function dataset(name)
which generates synthetic datasets to R. One of the datasets constant_file
is not generated/sampled, but is contained in an .Rdata file. Is it possible to return it when passed to the function dataset under name dataset(constant_file)
? I googled it, but it did not seem like an option.
The function dataset seems something like this:
Eigen::MatrixXd generate_dataset(std::string name) {
if (name == "box") {
... generate a uniform sample from box and return it...
}
if (name == "constant_file") {
... read the .Rdata or .csv and return it ...
}
}