[Rcpp-devel] How to call a function from an R package in cpp code

Amina Shahzadi aminashahzadi at gmail.com
Tue Oct 11 04:54:00 CEST 2016


Hi Rcpp Friends

I want to use dgev(x,shape=1,scale=1,location=0,log=FALSE) function of an R
package "FAdist" in the framework of Rcpp. How can I call that?

For example for the Poisson distribution which is basic function of R I
have written the following code.


#include <Rcpp.h>
using namespace Rcpp;

//[[Rcpp::export]]

NumericVector poiss(NumerixVector x, double lam, int give_log)
{
        return R::dpois(x, lam, give_log);
}


Thank you
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20161011/e67aeef5/attachment.html>


More information about the Rcpp-devel mailing list