Chapter 8: Code and download bundle

R Code

All verbatim chunk codes used in the Chapter are available in geos.R. This file contains the code used in the production of the book, and may be used for reference. It will not be changed, and may fall behind current releases of R and contributed packages. A simplified, modified, file geos_mod.R is also available, and will be kept up to date with reference to current R and contributed packages.

It is included in the chapter script and data sets bundle as a zip archive. The easiest way to reproduce the analyses in this chapter is to download and unzip the bundle, start R in the directory in which the bundle was unpacked, and say:

source("geos_mod.R", echo=TRUE)

Note that some chapters involve very time-consuming analyses!

It is possible to download the code for all chapters using this short R snippet:

chapters <- c("hello", "cm", "vis", "die", "cm2",
"std", "sppa", "geos", "lat", "dismap")
# setwd() # move to download folder
for (i in chapters) {
fn <- paste(i, "mod.R", sep="_")
download.file(paste(ASDAR_BOOK, fn, sep = "/"), fn)