Question

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

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top