<P>Hello i would like to compute the following code ;<BR><BR>Where R_user_F is a R function (i could write this function directly inin line but is only for example because i want to call an R function more complex):<BR>so when compile appear this error message: error: <BR>"cannot convert 'Rcpp::sugar::Comparator_With_One_Value<14, Rcpp::sugar::greater_or_equal<14>, true, Rcpp::sugar::Minus_Vector_Vector<14, true, Rcpp::Vector<14>, true, Rcpp::Vector<14> > >' to 'bool' in initialization."<BR><BR> I can do for solve this problem? Thank You.<BR><BR>The code:<BR><BR>R_user_F<-function (par) {<BR>y<-par[1]<BR>x<-par[2]<BR>dnorm(x)*dnorm(y)<BR>}</P>
<P> </P>
<P>require(inline)<BR>code <- '<BR>NumericVector f1;<BR>NumericVector f2;<BR>NumericVector par1;<BR>NumericVector par2;<BR>NumericVector a=2;<BR>NumericVector b=3;<BR>NumericVector par =par;<BR>par1=par*b;<BR>par2=par*a;<BR>Function R_userf(fun);<BR>f1=R_userf(par1);<BR>f2=R_userf(par2);<BR>bool u = (Rf_runif(0.0,1.0) <= f2-f1 );<BR><BR>'<BR>RcppGibbs <- cxxfunction(signature( par ="NumericVector", fun="function"),<BR>code, <BR>include='#include <math.h>', <BR>plugin="Rcpp")<-function (par) {<BR>y<-par[1]<BR>x<-par[2]<BR>dnorm(x)*dnorm(y)<BR>}</P>
<P> </P>