Skip to content
Prev 9542 / 10988 Next

[Rcpp-devel] Rcpp sugar for double?

Hello, 

Functions in sugar only apply to vectors. 

For a single value, you?d have to use the dnorm function in the R:: namespace: 

// [[Rcpp::export]]
double test6(double x){
  double y = R::dnorm(x,5.0,2.0,true);
  return y;
}
[1] -2.112086
[1] -2.112086


Romain