Published using Google Docs
errata
Updated automatically every 5 minutes

Errata

R Workshop site

Errata that are in both the first and second (“corrected”) printing are underlined. (Bold text is merely moderately more confusing or important).

Ignore references to the PET package. Long ago, I envisioned using "PET" for the name of my R package. IGNORE ALL REFERENCES TO THE PET PACKAGE. The correct package to install and load is the primer package.

I would greatly appreciate learning about any mistakes you find (HStevens_at_MiamiOH.edu).
Many thanks to Eric Rexstad (University of St. Andrews) for 50 corrections, and Ann Showalter (Miami University) for 54 more corrections (and counting).

WARNING

A common error: Please note that “+” is a continuation symbol and part of R’s self-annotation. It indicates that a statement of code is not complete. For instance, in the following code, the “+” tells us that the statement is no finished until we close the parenthesis.

> a <- 10 / (10  *  3

+                )

The plus sign should not be interpreted as a mathematical symbol, but rather as annotation to code, in the same way that “>” does not mean “greater than” but is merely the prompt of the editor. You will often create this error if you try to cut and paste code from a PDF document containing code.

DemoInfo() function

This function can return incorrect values for reducible projection matrices. I wrote another version, DemoInfo2(), which corrects this. It is available at this link. Download and place in your working directory, then run

> source(“DemoInfo2.txt”)

Use it as you would DemoInfo.

> DemoInfo2(A)

where A is your projection matrix.

Links to errata for:

Chapter 1, Chapter 2, Chapter 3, Chapter 4, Chapter 5, Chapter 6, Chapter 7, Chapter 8, Chapter 9, Chapter 10, Appendix, The R Package, primer

Chapter 1

p. 5: third line in sec. 1.2 it's -> its
p. 6, Fig 1.2; floating "ht" below graph means nothing.
p. 7, first line after second equation; 2 -> 3
p. 7, third equation in section 1.3.1; = 3(3(2N2001)) -> = 3(3(3N2001))
p. 11: fig 1.4 caption refers to numbers not on graph
p. 11, fourth line; the random variable is R, not R^4. The 4 should be outside the period. It refers the reader to the fourth footnote of the chapter, at the bottom of the page.
p. 13: The code box using the "sparrows" data set assumes you have loaded the primer package with library(primer) and then should include first the code data(sparrows) in order to make this data set available.
p. 17: near bottom, refers to population 3 in fig 1.4. This should refer to the population with lambda > 1.
p. 18: unnumbered equations: should be on separate lines, as in
Nt=N0e^(rt)
log(Nt) = log(N0) + rt
p. 21: The footnote references the PET R package. This was my original name for what is now the primer package.
p. 22: footnote 9: Rto -> R to
p. 23: footnote 10: replacemnt -> replacement.

P. 29: The text reads

> R.limits

                                        

[1] 0.8968 1.1302

                                        

What do we see immediately about these values? One is less than 0, and one is greater than 0.

This should read “less than 1 and one is greater than 1”

                                

                        

                

Chapter 2

p. 43: In the top box, Finding lambda.

The original code is:

dom.pos <- which.max( eigs.A[["values"]] )

L1 <- Re(eigs.A[["values"]][dom.pos])

It should be:

dom.pos <- which.max(Mod(eigs.A[["values"]]))

L1 <- Mod(eigs.A[["values"]][dom.pos])

(A thank you to Allison Shaw!)

p. 45-46: Although the description is correct and the code is correct, these two formulae were not.

eq. 2.12 should read

The notation in Equation 2.13 is ambiguous. To calculate the sensitivities, we use the left eigenvector, v, and the right dominant eigenvector, w. The sensitivity matrix is the quotient of the outer product and the dot product of v and w, that is,

p. 48. The elements of the elasticity matrix sum to 1 (not zero).

p. 52: inidvidual -> individual; raw datat -> raw data

Chapter 3

p. 69: extra period in line 5.
p. 71: missing tilde in xyplot(y~x|g).
p. 78: text box: eqn references incorrect (should refer to eqs. 3.20 and 3.21).
p. 78: below text box: reference to 3.15 should be 3.19
p. 79: just before eqn 3.26 should be reference to eqn 3.14 not 3.24
p. 81: caption to 3.10: reference to F(N) can be ignored --- simply refers to the
y-axis, dN/dt.
p. 82: calcculate -> calculate

p. 84: “...by 63% (i.e. 1/e)...”        ->      “...by 63% (i.e. 1-1/e)....” This is because the displacement due to the perturbation of the system is x[0], and the change in position during the return is calculated as as the starting point minus the end point, or x[0]-x[0]/e = x[0](1-1/e). Thus the system moves x[0](1-1/e) and remains x[0]/e away from the equilibrium.
p. 87: affecct -> affect; esle -> else
p. 87: Equation 3.36 has a big typo - there should not be any logarithm. It should be dN/dt = rN(1-(alphaN)^theta). Note that the R function thetalogistic is the correct form, as described here, and in the code boxes in the text.
p. 89: text box on theta-logistic dynamics: inconsistent use of assignment operator -- should read prms <- c(r=0.75, alpha=0.01, theta=1).
p. 91: MSY box: reference to eqn 9.6 should read "solution to eq. 3.44".
p. 91: reference to Roughgarden and Smith uses year rather than [sequential reference] format; it is reference 182.
p. 94: Fig. 3.15, wrong figure/caption combination. The figure should have a time-series panel for
each culture, rather than the one culture shown.
p. 102: Fig 3.19: caption should refer to object 'modSlope2' not 'modSlope'.
p. 104: parametersa -> parameters
p. 108: problem 3.4 part (a): Find expressions for population growth rates when N = K/4, K/2, and 3K/4.
p. 108: problem 3.4 part (a): harvestetd -> harvested.
p. 108: problem 3.4 part (d): 'theta' did not get converted to the symbol.

Chapter 4

p. 113: poopulation -> population.

p. 120: First paragraph in section 4.3.3, the explanation of the rescue effect. Tom Crist helped me realize that the hypothetical example I use is wrong. What I describe (extinction followed by colonization) is incorporated into the colonization term, cp(1-p). In fact, the rescue effect reduces extinction rates most when p is large, 0.5 < p <= 1. Thus it is not so much a rescue of a rare population, as it is a bonus for an already widely distributed organism. That is, it is an example of the rich getting richer.  Further, for the rescue effect, total extinction rate, E,  is highest at p=0.5, where E=0.25e. Extinction goes toward zero at low p because there is a small number of plots that could go extinct. Extinction approaches zero at as p approaches 1 because so few are empty...or so many are donating propagules.

The biggest difference from Levins is at the highest p.

At p -> 0

Levins E and Rescue E -> 0

At p = 0.5

Levins E = 0.5e

Rescue = 0.25e

At p -> 1,

Levins E -> e

Rescue E -> 0

So,

Rescue reduces extinction rate by ep^2

E[L] - E[R] = ep^2

sigh.

This confusion illustrates how powerful, and how misleading, WORDS can be -- at least on those feeble-minded like me.


p. 120: just before eqn 4.13 there is a leading minus sign missing in the embedded equation ep(1-qp). That is, the extinction rate is a negative rate or negative direction, with absolute magnitude of ep(1-qp).
p. 121 graphing box: rsult -> result.
p. 123: metttapopulation -> metapopulation.
p. 132: metapoopulation -> metapopulation.

Chapter 5

p. 138 typo: paopulation -> population.

p. 140. Subheading 5.2 should read Equilibria, not Equilbria
p. 143, 7th line in 5.2.2; line begins with a period from the previous sentence/line
p. 144: reference to non-existent eqn 5.2.2; this should refer to species 1's population growth rate, e.g., dN1/dt=r1N1(1-a11N1 - a12N2).
p. 154: reference to eqn 4.17 should be to eq. 5.12 and 5.13.
p. 156, 3rd line after eq. 5.27; the units of return time the same as for r -> the units of return time are the same as for r
p.158, problem 5.1d; cappacities -> capacities

Chapter 6

p. 161, line 6; (i.e. grow) -> (i.e., grow)
p. 162, line 7; cosumer -> consumer
p. 168: '...follow this up a peek...' -> 'follow this up with a peek...'.
p. 169, first line after eq. 6.9; equibria -> equilibria
p. 174: 'left of dashed predator isocline' should read 'right of dashed...'
p. 176: text box: first line 'to' -> 'two', and later 'Know' -> 'Now'.
p. 177, first line in 6.1.4; MacArhtur -> MacArthur
p. 177: third paragraph of section 6.1.4, '...nevering return...' -> '...never returning... .'
p. 177: eqn 6.30 should be 6.19
p. 180: footnote 10: capitalize 'French'.
p.193, last line of page; occur? -> occur.
p.194, second to last line of text; (i.e. disease growth) -> (i.e., disease growth)

p. 195. Eq. 6.40 should be the rate of change of resistant individuals, , not of infected individuals.
p. 196: in first paragraph, 'does will' -> 'does'.

p. 198: I compared the disease outbreak criterion with frequency dependent transmission to that with density dependent transmission. I stated that with density dependent (mass action) transmission, outbreak could be avoided by reducing 'the population, N, to a sufficiently low density.' I have since been asked whether I didn't mean reduce population of susceptibles S. I meant N, not S, because the context I tried to emphasize is the we assume that for pre-outbreak conditions, S=N is approximately correct. I wanted to emphasize both this pre-outbreak condition, and the uninformed state, where we do not know who is infected, and sometimes try to reduce N, with out learning about which individuals are infected. It is also technically true that S, and not N, controls the outbreak. Indeed, the whole point of vaccinations is to reduce S without having to reduce N. Perhaps I could have been more clear on page 198, and could have said ' a sufficiently low N (where N is approximately S).
p. 199 text box: 'Here We' -> 'We'.
p. 200 eqn 6.42: 'beta' not converted to symbol.
p. 204: First complete paragraph, 'Nelder-Mea' -> 'Nelder-Mead'.
p. 204: Bottom paragraph reference to known size of vulnerable population of Bombay as 10. This should be N=exp(10), not N=10.
p. 206: before beginning of section 6.4: '...predicts a confidence for...'-> '...predicts a confidence interval for...'

p. 206: 'duration (in weeks)' is wrong, it should be in days. Recall that our data are in units of weeks; this means that the units of 1/gamma are weeks. Therefore, we must multiply by 7 to get duration in days.

Chapter 7

p. 211: fig 7.1 caption refers to a label 'v' that is not present. 'v' should have been adjacent to links between P and R, and '1-v' should have been adjacent to links between P and B.
p. 213, last sentence of page; but by -> but is by
p. 214, second line after eq.7.1; (i.e. ri) -> (i.e., ri)

p. 215.

-- The directed connectance of Fig. 7.2a is 7/16 (not 4/16).

-- Eq. 7.2 should sum a^2, not merely a.
p. 217, 3rd line in point 6, held -> hold
p.219, 5th line after summary of out.A; let's -> Let's
p. 220: first line should read '...return times will be very large, and therefore stability will be effectively zero.' 
p.220, 2nd line after summary of RT.A; an every changing world -> ever-changing world
p.220, 2nd line from the bottom; webs are -> webs that are
p. 222 top: Fig without an accompanying number should be Fig. 7.5b.
p.222, 3rd line after Fig. 7.6; the number of species -> the same number of species
p.224, Fig. 7.7 legend; remove the reference to red line. I was torn about creating and describing features (including color) that are only apparent when writing and executing code as opposed to reading the B\&W book, and when I changed code, I neglected to change the text.

Chapter 8

p. 227: "Alternate" should be "alternative." Ouch. Alternate means every second in a series, as in "alternate Wednesdays." It may also imply occurring by turns, as with alternate limits in a stable limit cycle. This might apply to alternative equilibria, but not necessary. "Alternative" means simply different, and is more appropriate for MBA's, ASS's or ASE's.
p. 227: creaate -> create.
p.228: 2nd line above 8.1.2; prefer term -> prefer a term
p.230: lecture -> this book
p.230: section 8.2, second line in 3rd paragraph, "anti-competitive"
vs. "competitive"? -- My intent here was to highlight illegal business practices that -- -- ultimately reduce competition because they create monopolies. Thus -- -- they are competitive (or amensal) in an ecological sense, but -- -- anti-competitive in a human social/economic sense.

p. 236, 2nd printing, last line, or 1st printing, p. 237, fourth line: “Once precipitation reaches a particular threshold, precipitation drops dramatically,...” This should read, “Once temperature reaches a particular threshold, precipitation drops dramatically,...”
p. 238-9: superscript of "-1" should all be in superscript, as in mg N L-1. Currently only the minus sign is in superscript.
p.239: 1st line; increasing -> increase
p.240: 1st line after Fig. 8.6; What -> Wait
p.246: 9th line from bottom; IGP prey -> IG-prey
p.246: 8th line from bottom; IGP predator -> IG-predator
p.247: 1st line of 8.4.4; IGP -> IG
p.249: 2nd line above last section of R code; now simply -> now we simply
p.250: 5th line from bottom; IG-P prey -> IG-prey
p.251: 4th line from top; IGP prey -> IG-prey
p.251: 6th line from top; IGP prey -> IG-prey
p.251: 4th line of second full paragraph; predator invade -> predator can invade
p.251: 2nd line from bottom; (i.e. the -> (i.e., the
p.252: 2nd line from top; IGP predator -> IG-predator

Chapter 9

p. 258, line 6: should read "...if we assume that sp. 2 is the better colonizer..." (sp. 1 is the better competitor).

p. 271:

Figure 9.6 and supporting text.

the top line on p. 271 should read,
"(Fig. 9.6c). Where we have moderate disturbance (Fig.
9.6b)..."
The second reference to a figure currently is "Fig. 9.6c", but it should refer the reader to 9.6b.

p. 276

Last line of fourth paragraph (just before sec. 9.3.1) should read “..., and POSITIVE environment–competition covariation.”

         

Chapter 10

p.288: 2nd line from top; is difference -> is the difference
p.288: 2nd line after first R code; is difference -> is the difference.

p. 289: Eq. 10.2 is wrong. You need to sum the terms in the numerator and separately sum the terms in the denominator. The fraction created by these separate sums is the Bray-Curtis distance. What is shown is referred to as Canberra distance.
p. 293: Eq. 10.4; p ln (p) -> pi ln (pi)
p. 295: heavility -> heavily
p. 296: first line from top; substracting -> subtracting
p. 297: was a full 50.ha6 -> was a full 50 ha.6

p. 298, Fig. 10.6: A colleague called me in a panic asking what the heck was up with this figure. If the following were in the caption, it would have helped. "The solid line with open circles and accompanying dotted lines on the left show the typical rarifaction curve and 95% confidence envelope. The bars for the ACE and Chao2 estimates on the right are completely different, and merely represent the 95% confidence regions of their estimates -- the point estimates of these would typically be shown as a point somewhere near the middle of these bars. Their juxtaposition was simply to facilitate comparison."

p. 298, code: the object names generated with the function specpool in the vegan library have changed from uppercase to lowercase. Therefore, “Chao” must be changed to “chao”, and “Chao.SE” must be changed to “chao.se”.
p. 302: distirbution -> distribution
p. 304: distributions) -> distribution
p.305, last line; including as those -> including those
p.306, section 10.4, 6th line; organizations -> organization

p. 309. Table 10.2. The variable x should be between zero and one (0 ≤ x ≤ 1, x = n/J).
p.310, section 10.4.1, 2nd line; envisioned some -> envisioned as some
p. 311, eq. 10.10: θ(xn)/x -> θ(xn)/n

p. 311, eq. 10.13: The second term in this equation has an extra m that should not be there. Specifically, mu[k] should be just u[k], making the second term m(1-u[k]/J[M])n/J[L].
p. 312: exxplore -> explore
p. 313: number of generations is not consistent. Code uses 2500, but text says (mistakenly) 1000, or 2000 in different places. Also, the text makes reference to 9/900 deaths per generation” or “450 trees” , whereas the code uses 500 individuals (25 individuals of 20 species to start) rather than 900 or 450.
p.315, 2nd line; probaibllities -> probabilities
p.317, section 10.4.3, 1st line; quantitfication -> quantification
p. 317: Jabot and Chave estimated θ using two different phylogenies and thus came up with two different θ's;
m is the same, within 3 decimal places.
p. 322: Missing data set, moths.
Here is the tab-delimited file. These data belong to Keith Summerville (UC - Berkeley) and Thomas Crist (Miami University). Please contact them if you would like to use these data for anything other than teaching.
p. 330: first line, a link BETWEEN island biogeography and β diversity.
p. 331: Fig. 10.20. in figure, β area is cutoff, and there is an odd "orre" across the figure. My guess is it is four letters of "Corrected Proof."

Appendix

p. 335. An odd symbol was substituted for S. S is the precursor to R, and R is a dialect of S.

The R Package, primer

primer version 0.20
In the function MetaSim, the help page is incorrect regarding how phi controls variation. The actual range is
relative to the per capita rates, so the actual distribution is Uniform(rate*(1-phi), rate*(1+phi)), where rate=ci, or rate=e. That is, phi=.5 means that the range of ci is ci +/- 50%.