Re: [Rcpp-devel] Call R function (bbo...@tin.it)

2012-06-20 Thread Douglas Bates
On Wed, Jun 20, 2012 at 11:22 AM, Silkworth,David J. wrote: > I am not going to ask why to do this, but here is a way how. > > I added your R function into the mypackage skeleton from RcppPackage > > R_user_F<-function (par) { > y<-par[1] > x<-par[2] > return(dnorm(x)*dnorm(y)) > } > > I prefer to

Re: [Rcpp-devel] Call R function (bbo...@tin.it)

2012-06-20 Thread Silkworth,David J.
I am not going to ask why to do this, but here is a way how. I added your R function into the mypackage skeleton from RcppPackage R_user_F<-function (par) { y<-par[1] x<-par[2] return(dnorm(x)*dnorm(y)) } I prefer to use the explicit return function for clarity. Now I install the package after