<div dir="ltr"><div><div><div>Hi,<br><br></div>`round` is part of Rcpp sugar for a long time now (<a href="http://dirk.eddelbuettel.com/blog/2012/10/01/">http://dirk.eddelbuettel.com/blog/2012/10/01/</a>).<br></div>The way you use round is wrong you need to supply two arguments ('x' and 'digits'), Rcpp::round just wrap Rf_fround <br>
 (which is an alias for fround) in Rmath.h so you can check in this file the right signature.<br></div><div><br><br>#include <Rcpp.h><br>using namespace Rcpp ;<br><br>// [[Rcpp::export]]<br>NumericVector h1(int samp, int wind){<br>
    return round(runif(samp*3)* wind, 0);<br><br>}<br><br><br></div><div>Hope this help<br></div><div><br><br><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Mar 4, 2014 at 11:30 AM, Hideyoshi Maeda <span dir="ltr"><<a href="mailto:hideyoshi.maeda@gmail.com" target="_blank">hideyoshi.maeda@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Rcpp devel list<br>
<br>
I am trying to run the following code but for some reason it says that there is "no matching function for call to ‘round’"<br>
<br>
#include <Rcpp.h><br>
using namespace Rcpp;<br>
<br>
// [[Rcpp::export]]<br>
Rcpp::IntegerVector h1(int samp, int wind){<br>
  return round(runif(samp*3)*wind);<br>
}<br>
<br>
I thought round was part of Rcpp sugar? is it not?<br>
<br>
thanks<br>
<br>
<br>
_______________________________________________<br>
Rcpp-devel mailing list<br>
<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Ahmadou H. DICKO<br>statistician economist (Ingénieur Statisticien Économiste)<br>PhD candidate in Climate change economics<br>Faculty of economics and managment - Cheikh Anta Diop University<br>
West African Science Service Center on Climate Change and Adaptated Land Use (WASCAL)<br>Center for Development Research (ZEF) - University of Bonn <br>email : <a href="mailto:ahmadou.dicko@ucad.edu.sn" target="_blank">ahmadou.dicko@ucad.edu.sn</a><br>
twitter : @dickoah<br>github : <a href="https://github.com/dickoa" target="_blank">github/dickoa</a><br>tel : +221 33 827 55 16<br>portable: +221 77 123 81 69<br></div>
</div>