我想同时使用 RcppGSL 和 RcppArmadillo,是否可以在 cxxfunction(内联 CRAN 包的)中使用多个插件?我找到了一种方法:
plug.ArmaGSL <- Rcpp:::Rcpp.plugin.maker(include.before='#include <RcppArmadillo.h>
#include <RcppGSL.h>
#include <gsl/gsl_rng.h>',
Depends=c("RcppGSL", "RcppArmadillo", "Rcpp"),
LinkingTo=c("RcppGSL", "RcppArmadillo", "Rcpp"),
libs="-lgsl -larmadillo")
registerPlugin("RcppArmaGSL", plug.ArmaGSL)
foo <- cxxfunction(signature(sM="numeric"), body=bodytxt, inc=inctxt, plugin="RcppArmaGSL")
但它似乎不是那么直观。