Closed fintzij closed 4 years ago
That was fast!
Sure thing, just pushed the updates. Minimal working example below. The way this would get used in an R package is that you would link to extraDistr in the Description file and then put #include <extraDistr.h>
at the top of the C++ code where you want to use the distributions in extraDistr.
`library(Rcpp)
cppFunction( "Rcpp::NumericVector rbetbinom(int n, Rcpp::NumericVector size, Rcpp::NumericVector alpha, Rcpp::NumericVector beta) { return extraDistr::cpp_rbbinom(n, size, alpha, beta); }", depends = "extraDistr")
rbetbinom(10, 100.0, 5.4, 2.3) `
Not sure why one of the tests is failing. I only updated the date and version in the Description and the NEWS files. All tests pass on my machine as well. I suspect the failing p-r-random-test is unrelated to this PR.
OK: 3198 Failed: 0 Warnings: 0 Skipped: 9
I've re-run the tests and they pass. Maybe mention in NEWS, or other place that it's your contribution?
I'll look at it tomorrow and if possible merge and post to CRAN.
Sounds good, thank you!!
Added C++ interface to distributions and generated C++ header file to allow for packages with C++ code to link to extraDistr