@@ -104,7 +104,7 @@ The goal of the function \texttt{foo} code is simple. Given two
104104
105105<<eval =FALSE >>=
106106foo <- function (x , y ){
107- ifelse( x < y , x * x , - (y * y ) )
107+ ifelse( x < y , x * x , - (y * y ) )
108108}
109109@
110110
@@ -218,7 +218,6 @@ NumericVector res = -x ;
218218// use it as part of a numerical expression
219219NumericVector res = - x * ( x + 2.0 ) ;
220220
221-
222221// two integer vectors of the same size
223222NumericVector y ;
224223NumericVector z ;
@@ -243,7 +242,6 @@ given a logical sugar expression.
243242<<lang =cpp >>=
244243IntegerVector x = seq_len( 1000 ) ;
245244all( x * x < 3 ) ;
246-
247245any( x * x < 3 ) ;
248246@
249247
@@ -448,7 +446,7 @@ pow(x, z) # x to the power of z
448446
449447% log() and log10() maybe? Or ln() ?
450448
451- \subsection {The d/q/p/q statistical functions }
449+ \subsection {The d/q/p/r statistical functions }
452450
453451The framework provided by \sugar also permits easy and efficient access the
454452density, distribution function, quantile and random number generation
@@ -460,8 +458,8 @@ would in \proglang{R}:
460458
461459<<lang =cpp >>=
462460x1 = dnorm(y1 , 0 , 1 ); // density of y1 at m = 0 , sd = 1
463- x2 = pnorm (y2 , 0 , 1 ); // distribution function of y2
464- x3 = qnorm (y3 , 0 , 1 ); // quantiles of y3
461+ x2 = qnorm (y2 , 0 , 1 ); // quantiles of y2
462+ x3 = pnorm (y3 , 0 , 1 ); // distribution function of y3
465463x4 = rnorm(n , 0 , 1 ); // ' n' RNG draws of N(0 , 1 )
466464@
467465
0 commit comments