我需要arma::在我的Rcpp代码中包含变量.但是在尝试使用糖功能时遇到了问题pnorm.这是一个演示:
#include <RcppArmadillo.h>
#include <RcppArmadilloExtensions/sample.h>
// [[Rcpp::depends(RcppArmadillo)]]
using namespace Rcpp;
// [[Rcpp::export]]
double pget(NumericVector x, NumericVector beta) {
arma::colvec xx = Rcpp::as<arma::colvec>(x) ;
arma::colvec bb = Rcpp::as<arma::colvec>(beta) ;
double tt = as_scalar( arma::trans(xx) * bb);
double temp = Rcpp::pnorm(tt);
return temp;
}
Run Code Online (Sandbox Code Playgroud)
然后我收到一个错误: no matching function for call to 'pnorm5'
这是否意味着我不能使用Rcpp::pnorm???