[Rcpp-devel] Rcpp sugar for double?
ep19772 at gmail.com
Wed Feb 22 15:58:35 CET 2017
Hi, I just tried to calculate the density of a normal variable using dnorm.
I found that if the input is of type NumericVector, then it was fine. But
if the input is of type double, it yielded error in compilation. For
NumericVector test5(NumericVector x)
NumericVector y = dnorm(x,5.0,2.0,true);
double test6(double x)
double y = dnorm(x,5.0,2.0,true);
May I ask why and how can I calculate this density (and call other common
functions like dbeta, dt, beta, gamma, lbeta, lgamma, etc...) on double
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Rcpp-devel