Call a function from c++ via environment Rcpp

后端 未结 1 1977
春和景丽
春和景丽 2020-11-29 10:59

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;



// [[         


        
1条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-29 11:34

    fivenum function is not defined in the global environment but in the stats package enviroment, so you should get it from that:

    ...
    Environment stats("package:stats"); 
    Function f = stats["fivenum"];
    ...
    

    0 讨论(0)
提交回复
热议问题