Errata

Significant or confusing errors

  • p. 36: as pointed out by Francois Teste, species is the third and not the second column of the SeedPred data set, hence the first two code chunks and intervening text should read:
> SeedPred[[3]]
> SeedPred[["species"]]
> SeedPred$species

all extract the third column (a factor containing species abbreviations) from the
data frame SeedPred. You can also treat the data frame as a matrix and use square
brackets [] to extract the third column:
> SeedPred[, 3]

i.e., replace all references to the second column with references to the third column.
  • pp. 45-46: because of a change in R 2.7.0, this example no longer works as written (argh!!) The bug fix is listed in the NEWS file as:

o co[rv](use = "complete.obs") now always gives an error if there are no complete cases: they used to give NA if method = "pearson" but an error for the other two methods. (Note that this is pretty arbitrary, but zero-length vectors always give an error so it is at least consistent.)

The effects of this change are discussed here and here; in short, it means that (e.g.) sd(c(NA,NA,NA),rm.na=TRUE) gives an error rather than returning NA. In turn, that breaks the first code chunk (computing the standard deviations) on p. 46, because the observations with zero seeds available all have taken/available equal to NA. To fix this, I would replace the first code chunk on p. 45 with something like:

detach(SeedPred)
nz = subset(SeedPred,avail>0)
attach(nz)
frac.taken = taken/available

and then detach(nz) at the end of p. 46 (the first code chunk on p. 47 also becomes redundant in this case). (Thanks to Nicole Gottdanker.) [update 16 Sep 2008: it now looks as though R will revert to the original behavior in version 2.8.0. On the other hand, the replacement code here is slightly nicer.]
  • p. 42: the second mosaicplot example should be mosaicplot(available~taken,data=SeedPred) (rather than available+taken). It's also potentially useful to do mosaicplot(available~taken,data=SeedPred,subset=taken>0) (Francois Teste)
  • p. 44: in the caption, barplot(t(log10(t1+1)), beside = FALSE) should be …beside = TRUE) (Francois Teste)
  • p. 68: Before plotting init.dens against surv.dens, you have to define them: in the code for chapter 2 this was actually done (invisibly) in the code for Figure 2.9 (search for "chunk number 39" in the R code) as:
init.dens = init/area*1000
surv.dens = surv/area*1000

(Thanks to Jack Finn.)
The factors of 1000 are for scaling from per cm^2 to per 0.1 m^2.
  • p. 97, von Bertalanffy curve (figure and text): the expression for the generalized von Bertalanffy function should be
(1)
a (1-\exp(-k(1-d)(t-t_0)))^{\frac{1}{1-d}

(not a (1-\exp(-k(a-d)(t-t_0)))^{\frac{1}{1-d} as stated) — see Essington et al 2001. I could have sworn I checked this …

  • p. 160: there is a missing code chunk before the examples here, which defines the values of the variables for the simulation:
x = 1:20
a =2; b=1; sd=8
N = 20

(You can check this out in the chapter 5 code; search for "chunk number 31".) Thanks to Gavin Simpson.
  • p. 186: BUGS code is wrong (got out of sync with what is included in the emdbook package). You can find the real file by invoking
system.file("BUGS","myxo1.bug",package="emdbook")

which will show you
model {
  for (i in 1:n) {
     mean[i] <- a*day[i]*exp(-b*day[i])
     rate[i] <- shape/mean[i]
     titer[i] ~ dgamma(shape,rate[i])
  }
## priors
a ~ dgamma(0.1,0.1)
b ~ dgamma(0.1,0.1)
shape ~ dgamma(0.1,0.01)
}

(the mistake is a confusion between the rate and scale parameterizations of the Gamma distribution, as warned about directly below this example on p. 186! (Thanks to Mike Meredith.)
  • p. 190 and 191: figure captions are switched between 6.8 and 6.9! (This one is really unfortunate because I told PUP about this in the copy-editing process — not my fault!) Also, on p. 188, last line, figure reference should be to Figure 6.8 (this one was my fault.) (Thanks to Mike Meredith.)
  • p. 264: the first displayed equation should be
(2)
(\beta-1)^{(-1/\beta)}/(1+1/(\beta-1))

(there was a missing set of parentheses in the denominator). Thanks to Fernando Taboada.

  • p. 321: eq. 10.3.2: (-x-\mu)^2 should be -(x-\mu)^2 (another one that's not my fault!) (Mike Meredith again.)

Minor glitches

  • p. 2: Sandin and Pacala 2005b should be just Sandin and Pacala 2005 (Eric Walters)
  • p. 3, footnote 1: spurious "a" after "to" ("I wanted to a write a book …")
  • Figure 5.1, p. 149: this figure somehow got screwed up between the galleys and the printed version :-(. The lines in the right subfigure (5.1b) got truncated/erased. The correct figure looks like this:
Fig_5_1.png
  • p. 175: "just very much" should be "just"
  • p. 248: top line, spurious "can"
  • p. 269: there is a big, spurious "OR" in the middle of the page. Don't know where that came from, it wasn't in the galley proofs???
  • p. 326: "Clark and Poulsen et al., 2005" should be "Clark et al., 2005"
  • p. 371: Crawley 2007: repeated author, should be horizontal line instead (Eric Walters)

The score so far:
errata.png

(see the code or data for this figure)


page_revision: 37, last_edited: 1228014069|%e %b %Y, %H:%M %Z (%O ago)
Unless stated otherwise Content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License