I am considering calling a R function from c++ via environment, but I got an error, here is what I did
#include using namespace Rcpp; // [[
fivenum function is not defined in the global environment but in the stats package enviroment, so you should get it from that:
stats
... Environment stats("package:stats"); Function f = stats["fivenum"]; ...