I am working on an R package that uses Rcpp. This has not been occurring until recently, and I’m not sure why. My Rcpp exported function is the declaration and definition, and I’m getting the following result when attempting to use roxygen2::roxygenize()
for my package:
The error
Here is my Rcpp C++ function header:
int threshold(std::string infile,
std::string outfile,
std::string method="absolute",
double threshold=0.0,
double local_global_alpha=0.0,
int rank=0
)
And here is the R/RcppExports.R wrapper for it:
threshold <- function(infile, outfile, method = "absolute", threshold = 0.0, local_global_alpha = 0.0, rank = 0L) {
.Call(`_thresholding_threshold`, infile, outfile, method, threshold, local_global_alpha, rank)
}
- I’ve tried changing the return type of the function to no avail.
- I tried removing the default parameters, but this also didn’t work. I’m confused as to why this is happening because I have another function header set up in a very similar way that works just fine:
void analysis(std::string infile,
Rcpp::NumericVector methods=Rcpp::NumericVector::create(),
std::string outfile_prefix="",
double lower=0.5,
double upper=0.99,
double increment=0.01,
int window_size=5,
int min_partition_size=10,
int min_clique_size=5,
double min_alpha=0.0,
double max_alpha=4,
double alpha_increment=0.1,
int num_samples=0,
double significance_alpha=0.01,
bool bonferroni_corrected=0,
bool overwrite = false
)
Please let me know if you have any ideas or debugging tips. I feel like I’m missing something very small.
- Rcpp Version = 1.0.11
- Roxygen2 Version = 7.2.3
snapplelevi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.