rcpp4everyone_en icon indicating copy to clipboard operation
rcpp4everyone_en copied to clipboard

Requesting further explanation of functions in Chapter 31 R Math Library

Open xmlongan opened this issue 2 years ago • 2 comments

Hello Tsuda, I am impressed by your book Rcpp for everyone. Thank you very much! However, I have a little confusion during reading of the book. Some of the functions in Chapter 31 R Math Library have different arguments as their counterparts in R, such as double R::bessel_i(double x, double al, double ex) v.s. besselI(x, nu, expon.scaled = FALSE). As an user, how can I use them correctly in CPP? Would it possible to offer more explanations in Chapter 31 or reference links?

Many thanks Yanfeng Wu

xmlongan avatar Sep 22 '22 14:09 xmlongan

Hi, @xmlongan. Thank you for reaching out to me.

The RMath library actually comes with R, not with Rcpp.

As you mentioned the usage of distribution functions in RMath library is not always identical to R’s counterpart. I do not have much knowledge about the RMath

You might look for the section of distribution functions in “Writing R extention” which is the official documentation for R package development.

https://cran.r-project.org/doc/manuals/R-exts.html#Distribution-functions

The Rcpp does not have official user-friendly documentation (that’s why I wrote my book), so I recommend you check the output of these distribution functions by visualizing them to understand the parameters before you use these functions.

teuder avatar Sep 23 '22 02:09 teuder

Thanks! I do find the explanations through the link! It helps me a lot.

xmlongan avatar Sep 23 '22 03:09 xmlongan