R code accompanying Spencer, M., "Size" change, "shape" change, and the growth space of a community.

1. For the Leicester hoverflies example, the data are in 

hoverflies.txt (tab-separated text with header, rows are years, species are columns, last column is year). Source:

@Book{Owen10,
  Author         = {Owen, J.},
  Title          = {Wildlife of a garden: a thirty-year study},
  Publisher      = {Royal Horticultural Society},
  Address        = {London},
  year           = {2010},
}

Code: 
to run the example code in R,

source("hoverflies.statespace4d.R")

requires the packages sspir, RColorBrewer. Ran in about 90 s on an Intel Xeon 3.2 GHz processor, 16 G RAM, Ubuntu 12.04 64-bit. As of 20/12/2013, sspir has been removed from CRAN because the maintainer's email address bounces, but the version in the CRAN archive still works.

Note that in the example, line 10,

reps <- 10

sets the number of bootstrap replicates to 10 for a quick demonstration. For the figures in the manuscript, 1000 replicates were used.

Creates a file hoverflyfit.RData containing the bootstrap replicates.

The package sspir outputs blank lines and the word "Univariate" for each species and each bootstrap replicate. Would be a good thing to prevent this if you want to run large data sets.

The file successionmeasures.statespace4.R contains the functions used in the analysis.

2. For the Surtsey higher plants example, the data are in

Surtsey.txt (tab-separated text with header, rows are years, species are columns, last column is year). Source: 

@article{Fridriksson89,
author = {Fridriksson, S.},
title = {The volcanic island of {S}urtsey, {I}celand, a quarter-century after it `rose from the sea'},
journal = {Environmental Conservation},
volume = {16},
number = {2},
pages = {157-162},
year = {1989},
}

Code:
To run the example code in R,

source("Surtseyscript.surreal4d.R")

requires the R packages RColorBrewer, Matrix. Should run in a negligible amount of time, and produce the figures in the manuscript.

The file successionmeasures.surreal2.R contains the functions used in the analysis.

Warning messages of the form

1: In arrows(xs, ssur$cossqtheta, xs + ascale * xr, ssur$cossqtheta,  :
  zero-length arrow is of indeterminate angle and so skipped

are nothing to worry about. On the figures, surreal numbers are represented with a circle showing the value of the infinite part, and an arrow showing the value of the real part. When the real part is zero, the length of this arrow is also zero.

Matthew Spencer
m.spencer@liverpool.ac.uk
22/09/2014

