Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requesting further explanation of functions in Chapter 31 R Math Library #24

Open
xmlongan opened this issue Sep 22, 2022 · 2 comments
Open

Comments

@xmlongan
Copy link

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

@teuder
Copy link
Owner

teuder commented Sep 23, 2022

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.

@xmlongan
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants