Anyone know How do I generate skew distribution using Rcpp? (for example skew normal or skew t).
By the way, how do I generate distributions that aren't defined in Rmath.h?
Edit:
I want use some function available in any package of R, for example the function rsn(n = 1, location = 0, scale = 1, shape = 0, dp = NULL) of the package ´sn´ to generate de skew normal distribution:
library(sn)
rsn(100, 5, 2, 5)
Thanks and Happy New Year
The sn package contains no C or C++ code, but only R code. So you could not have meant calling its compiled code, but just its R functions.
Which you can do via the Rcpp::Function()
object -- but the execution will be no different than calling directly from R.
An R function is still an R function, whether you can it from R or from from your C++ code via Rcpp.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.