<div>Hi,</div><div><br></div><div>I tried to call qchisq() (see mock code below). But while compiling it, I got an error message saying ` error: no matching function for call to ‘qchisq(double, double, int, int)’`. I checked this file: <a href="http://dirk.eddelbuettel.com/code/rcpp/html/Rmath_8h_source.html">http://dirk.eddelbuettel.com/code/rcpp/html/Rmath_8h_source.html</a>, and saw this: "<span style="font-size:13px;font-family:monospace,fixed;line-height:13px;white-space:pre-wrap;background-color:rgb(251,252,253)"> </span><span class="keywordtype" style="font-size:13px;color:rgb(96,64,32);font-family:monospace,fixed;line-height:13px;white-space:pre-wrap;background-color:rgb(251,252,253)">double</span><span style="font-size:13px;font-family:monospace,fixed;line-height:13px;white-space:pre-wrap;background-color:rgb(251,252,253)"> </span><a class="code" href="http://dirk.eddelbuettel.com/code/rcpp/html/namespaceR.html#a3a194e20767ad85ff10c659d9d0a6a74" style="font-size:13px;color:rgb(70,101,162);text-decoration:none;font-family:monospace,fixed;line-height:13px;white-space:pre-wrap;background-color:rgb(251,252,253)">qchisq</a><span style="font-size:13px;font-family:monospace,fixed;line-height:13px;white-space:pre-wrap;background-color:rgb(251,252,253)">(</span><span class="keywordtype" style="font-size:13px;color:rgb(96,64,32);font-family:monospace,fixed;line-height:13px;white-space:pre-wrap;background-color:rgb(251,252,253)">double</span><span style="font-size:13px;font-family:monospace,fixed;line-height:13px;white-space:pre-wrap;background-color:rgb(251,252,253)"> </span><a class="code" href="http://dirk.eddelbuettel.com/code/rcpp/html/external__pointer_8r.html#a745dfbf3bbf4ccff97d7b764f8694d25" style="font-size:13px;color:rgb(70,101,162);text-decoration:none;font-family:monospace,fixed;line-height:13px;white-space:pre-wrap;background-color:rgb(251,252,253)">p</a><span style="font-size:13px;font-family:monospace,fixed;line-height:13px;white-space:pre-wrap;background-color:rgb(251,252,253)">, </span><span class="keywordtype" style="font-size:13px;color:rgb(96,64,32);font-family:monospace,fixed;line-height:13px;white-space:pre-wrap;background-color:rgb(251,252,253)">double</span><span style="font-size:13px;font-family:monospace,fixed;line-height:13px;white-space:pre-wrap;background-color:rgb(251,252,253)"> </span><a class="code" href="http://dirk.eddelbuettel.com/code/rcpp/html/namespaceR.html#aa2395daa7cd108b9b8055148806e6d56" style="font-size:13px;color:rgb(70,101,162);text-decoration:none;font-family:monospace,fixed;line-height:13px;white-space:pre-wrap;background-color:rgb(251,252,253)">df</a><span style="font-size:13px;font-family:monospace,fixed;line-height:13px;white-space:pre-wrap;background-color:rgb(251,252,253)">, </span><span class="keywordtype" style="font-size:13px;color:rgb(96,64,32);font-family:monospace,fixed;line-height:13px;white-space:pre-wrap;background-color:rgb(251,252,253)">int</span><span style="font-size:13px;font-family:monospace,fixed;line-height:13px;white-space:pre-wrap;background-color:rgb(251,252,253)"> lt, </span><span class="keywordtype" style="font-size:13px;color:rgb(96,64,32);font-family:monospace,fixed;line-height:13px;white-space:pre-wrap;background-color:rgb(251,252,253)">int</span><span style="font-size:13px;font-family:monospace,fixed;line-height:13px;white-space:pre-wrap;background-color:rgb(251,252,253)"> lg)</span>" . The four arguments in the mock code also follow the double, double, int, int form. So I wonder what the problem is with my way of specifying the code. Thanks.</div>

<div><br></div><div><br></div><div><div>#include <R.h></div><div>#include <stdio.h></div><div>#include <RcppArmadillo.h></div><div>// [[Rcpp::depends(RcppArmadillo)]]</div><div><br></div><div>using namespace Rcpp;</div>

<div>using namespace arma;</div><div><br></div><div>RcppExport SEXP foo(SEXP X){</div><div><span class="Apple-tab-span" style="white-space:pre">      </span>NumericVector x(X);</div><div><span class="Apple-tab-span" style="white-space:pre">  </span>double output = qchisq(0.5, (double)x(0), 1, 0);</div>

<div><span class="Apple-tab-span" style="white-space:pre">      </span>return(wrap(output));</div><div>}</div></div>