Skip to content

Commit 7b4f72b

Browse files
committed
Merge pull request #445 from csgillespie/patch-1
One character typo: d/q/p/q -> d/q/p/r
2 parents c0d6185 + 1eaecd6 commit 7b4f72b

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

vignettes/Rcpp-sugar.Rnw

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ The goal of the function \texttt{foo} code is simple. Given two
104104

105105
<<eval=FALSE>>=
106106
foo <- 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
219219
NumericVector res = -x * ( x + 2.0 ) ;
220220
221-
222221
// two integer vectors of the same size
223222
NumericVector y ;
224223
NumericVector z ;
@@ -243,7 +242,6 @@ given a logical sugar expression.
243242
<<lang=cpp>>=
244243
IntegerVector x = seq_len( 1000 ) ;
245244
all( x*x < 3 ) ;
246-
247245
any( 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

453451
The framework provided by \sugar also permits easy and efficient access the
454452
density, distribution function, quantile and random number generation
@@ -460,8 +458,8 @@ would in \proglang{R}:
460458

461459
<<lang=cpp>>=
462460
x1 = 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
465463
x4 = rnorm(n, 0, 1); // 'n' RNG draws of N(0, 1)
466464
@
467465

0 commit comments

Comments
 (0)