[Rcpp-devel] Unit Test Question Was: pnorm/qnorm?

Rodney Sparapani rsparapa at mcw.edu
Wed Sep 12 15:38:09 CEST 2012


On 09/07/2012 12:19 PM, Dirk Eddelbuettel wrote:
> |>  As a general, looking at the unit test files can be helpful. Here is one for qnorm:
> |>
> |>     "runit_qnorm_prob" = list(
> |>     signature( x = "numeric" ),
> |>     '
> |>     NumericVector xx(x) ;
> |>     return List::create(_["lower"] = qnorm( xx, 0.0, 1.0 ),
> |>     		_["upper"] = qnorm( xx, 0.0, 1.0, false));
> |>     ')

The unit tests are indeed very helpful.  However, I have been trying to
figure out how the unit tests were developed.  As far as I can see,
there is nothing in Rcpp nor Rmath.h that actually specifies the
prototypes like the example above (and I did look, hence my initial
confusion about the syntax of qnorm).  Were these written simply by
looking at the R help itself like ?qnorm or were they automated in
some way?  Thanks

-- 
Rodney Sparapani, PhD  Center for Patient Care and Outcomes Research
Sr. Biostatistician               http://www.mcw.edu/pcor
4 wheels good, 2 wheels better!   Medical College of Wisconsin (MCW)
WWLD?:  What Would Lombardi Do?   Milwaukee, WI, USA


More information about the Rcpp-devel mailing list