Create two R functions with same name but different type of argument
问题 I am creating a package with Rcpp and I want to have a function than can accept as argument a std::string or a int . How can I do it? I have the following functions: int myFunction(std::string varname); RcppExport SEXP myFunction(SEXP varname) { BEGIN_RCPP Rcpp::RObject __result; Rcpp::RNGScope __rngScope; std::string myVarname = as<std::string>(varname); __result = Rcpp::wrap(myFunction(myVarname)); return __result; END_RCPP } int myFunction(int varname); RcppExport SEXP myFunction(SEXP