[Rcpp-devel] Error when calling `qchisq()`.

Xiao He praguewatermelon at gmail.com
Fri Jul 5 18:22:54 CEST 2013


Hi,

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:
http://dirk.eddelbuettel.com/code/rcpp/html/Rmath_8h_source.html, and saw
this: " double qchisq<http://dirk.eddelbuettel.com/code/rcpp/html/namespaceR.html#a3a194e20767ad85ff10c659d9d0a6a74>
(double p<http://dirk.eddelbuettel.com/code/rcpp/html/external__pointer_8r.html#a745dfbf3bbf4ccff97d7b764f8694d25>,
double df<http://dirk.eddelbuettel.com/code/rcpp/html/namespaceR.html#aa2395daa7cd108b9b8055148806e6d56>,
int lt, int lg)" . 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.


#include <R.h>
#include <stdio.h>
#include <RcppArmadillo.h>
// [[Rcpp::depends(RcppArmadillo)]]

using namespace Rcpp;
using namespace arma;

RcppExport SEXP foo(SEXP X){
NumericVector x(X);
double output = qchisq(0.5, (double)x(0), 1, 0);
 return(wrap(output));
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130705/ee7c603b/attachment.html>


More information about the Rcpp-devel mailing list