<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div><div>Dear all,<br><br></div>I am reading the Rcpp book Chapter 7 - Modules<br><br></div>The first example provide a C++ function<br><br></div><div>## C++ function<br></div>double norm( double x, double y){<br></div>        return sqrt(x*x + y*y);<br>}<br><br></div>## Simple wrapper function <br></div>using namespace Rcpp;<br></div>RcppExport SEXP norm_wrapper(SEXP x_, SEXP_y){<br></div>    double x = as<double>(x_), y = as<double>(y_);<br></div>    double res = norm(x,y);<br></div>    return wrap(res);<br>}<br><br></div>So, I have these two functions. But, I am lost, what should I do now?<br><br></div>The goal is make the function norm available in R.<br><br></div><div>Probably, this is a very basic question, so if anyone know some material on the internet that explain the missing parts here, please let me know.<br><br></div>Thank you.<br><br><br><div><div><div><div><div><div><div><div><div><div><br clear="all"><div><div><div><div><div><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Wagner Hugo Bonat<br>----------------------------------------------------------------------------------------------<br>Department of Mathematics and Computer Science (IMADA)<br>University of Southern Denmark (SDU) and<br>Laboratório de Estatística e Geoinformação (LEG)<br>Universidade Federal do Paraná (UFPR)<br><br></div></div></div></div></div>
</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>