I am trying to concert a dataframe to a matrix in rcpp as in this answer: best way to convert DataFrame to Matrix in RCpp
NumericMatrix testDFtoNM(DataFrame x) {
NumericMatrix y = internal::convert_using_rfunction(x, "as.matrix");
return y;
}
and I get the error:
Line 135 reference to 'internal' is ambiguous.
This seems to indicate that there is more than one active namespace with internal as a definition.
How can I find the extra internal and/or how can I fix the code to compile without the error?
Update: Allan gave me the solution and using Rcpp::inline does allow it to work, but not why and how I can find the correct namespace on my own.
my current namespaces are:
using namespace Rcpp;
using namespace std;
using namespace arma;
using namespace RcppParallel;
Clearly internal exists in more than one of them. Is there a way to find which references have it without trial and error.