Call R functions in Rcpp
<p>I was trying to call the sd(x), which is a R function, in Rcpp. I've seen an example of calling the R function dbate(x) in Rcpp and it works perfectly.</p>

<pre><code>// dens calls the pdf of beta distribution in R
//[[Rcpp::export]]
double dens(double x, double a, double b)
{
    return R::dbeta(x,a,b,false);
}
</code></pre>

<p>But when I tired to apply this method to sd(x) as following, it went wrong.</p>

<pre><code>// std calls the sd function in R
//[[Rcpp::export]]
double std(NumericVector x)
{
  return R::sd(x);
}
</code></pre>

<p>Does anyone know why this doesn't work?</p>