[Rcpp-devel] Rcpp-quickref patch - Inline, Random

Romain Francois romain at r-enthusiasts.com
Thu Dec 9 11:10:06 CET 2010


Le 09/12/10 06:34, Christian Gunning a écrit :
> Attached is a patch relative to pkg/Rcpp/inst/doc/Rcpp-quickref that
> supercedes the previous patch.  Advice on using stats functions is
> provided, and examples include doubles for distribution-specific
> parameters.

Thanks. Applied in rev 2751. (+ some minor tweaks related to the updated 
highlight)

> best,
> xian
>
> On Tue, Dec 7, 2010 at 3:15 AM, Christian Gunning<xian at unm.edu>  wrote:
>> Attached is a patch relative to pkg/Rcpp/inst/doc/Rcpp-quickref.
>>
>> I added Douglas' suggestion to the Matrix section.  In addition are
>> reference examples for inline and the random functions.
>>
>> There was a recent list question about dnorm, and I ran across similar
>> confusion.  Is the default argument cascade the same for all of the d*
>> family?  For dnorm, assuming numvec contains {-1, 0, 1}, we have:
>>
>> //Working:
>> NumericVector works1, works2;
>>   works1 = dnorm(numvec, 0, 1, false);
>>   works2 = dnorm(numvec, 0, false);
>>
>> As far as I could tell, all other combinations of missing arguments
>> fails at compile time.  Since e.g. rnorm(10) works, this seems a bit
>> counter-intuitive.  Personally, this isn't a priority for me - just
>> trying to figure out the system.
>>
>> best,
>> xian

-- 
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr
|- http://bit.ly/fT2rZM : highlight 0.2-5
|- http://bit.ly/gpCSpH : Evolution of Rcpp code size
`- http://bit.ly/hovakS : RcppGSL initial release




More information about the Rcpp-devel mailing list