Dr. Mark Gardener


Home > Publications > Community Ecology: News

Community Ecology

Analytical Methods Using R and Excel

by: Mark Gardener

Available now from Pelagic Publishing.

On this page find details about changes to the support material for Community Ecology. These changes will include:

  • alterations and improvements to custom R commands
  • new custom R commands
  • additional data
  • extra exercises

The changes are listed below in date order (newest entries at the top). Alterations will be reflected in the existing support pages, essentially:

  • Any altered or additional R commands will be added to the CERE.RData support file and the ZIP Archive found on the Support Files page.
  • Any extra data will be added to the Zip Archive (and CERE.RData file if in R-format) found on the Support Files page. Notes about the custom commands will be updated in the Custom Commands page.
  • Any extra exercises will be presented on the website (I will make new pages as required).



Jun 2015

New command:


Get the file: here


June 2015

New command to carry out Polar Ordination (aka Bray-Curtis ordination):


This is a new command that conducts polar ordination (also called Bray-Curtis ordination). The book shows polar ordination and presents a method to carry it out using Excel (Chapter 14). This is labour intensive but instructive for students, as it shows some of the basic principles behind ordination in general. However, I thought it would be useful to have an R command to carry out the procedure.

The command works out polar ordination site scores and works out axes as follows: Axis 1 is the combination of sites that gives the maximum separation (not necessarily the maximum variance explained). Axis 2 is the combination of sites that maximises the orthogonality to the 1st axis.

There are print, plot and summary methods and an identify method for use with plots.



print.polar.ord(ord, digits = getOption("digits"))

summary.polar.ord(ord, k = 2, cor = TRUE, var.exp = TRUE, digits = getOption("digits"))

plot.polar.ord(ord, x.axis = 1, y.axis = 2, type = c("t", "p", "n"), ...)

identify.plot.polar.ord(pord, labels = pord$labels, ...)

diss A dissimilarity matrix e.g. as produced by dist() or vegdist()
digits The number of digits to display, defaults to current settings
ord The result of a polar.ord command
k The number of axes to display
cor If TRUE, shows the correlation between ordination axes
var.exp If TRUE, shows the variance explained
x.axis Which ordination axis to plot on the x-axis
y.axis Which ordination axis to plot on the y-axis
type The type of plot, "t" text, "p" points or "n" none
pord The result of a plot.polar.ord command i.e. a polar ordination plot result
labels A vector of labels to use for the sites
... Other plotting parameters to pass to plot or identify


See examples in the Custom R Commands page.

Get the file

You can get a copy of the .R file here. Click the link to open the text. Right-click and "Save As" to download the file.

Use the file

The routines are in the main data file. However, if you get the Polar Ordination.R file separately, it opens in any text editor. To install the commands in R use something like:


Then select the file. In Linux you'll need to specify the filemane explicitly.

Feb 2015

New commands:


Updated commands:


Imported from vegan 1.17.12:


Support Files

Custom Commands


February 2015

Modified command:


This formerly computed bootstrap confidence intervals only (for "shannon" or "simpson"). Now you can specify "shannon", "simpson", or "invsimpson", which use H_CI() and methods using variance estimates. The command calculates the appropriate diversity index and CI, then plots the result.

NOTE: returns an error if you specify boot = TRUE and index = "invsimpson".

New command:


This compliments the functions Happ() and Dapp(). It calculates bootstrap CI for Inverse Simpson's index ("invsimpson"). Designed for use with apply() and others as an "internal" command.

New command:


This is a wrapper for add1() that allows display of potential variables in order of AIC. You can specify order (default: decreasing = FALSE) and number of "results" to display. Specify n = "all" to show all results (the default), or integer to display n results. This is useful when your pool of potential variables (the scope parameter) is large.

Imported & modified commands from vegan 1.17.12:

Some changes in recent versions of the vegan R-package prompted a few alterations.

Fisher's log series:

The vegan team removed Std Err calculations from fisherfit(). There are sensible reasons for doing so as CI are somewhat "dodgy". However, to get the same results as the exercises in the book I restored the behaviours. If you want to get the same output as the book then use fisher_alpha() and fisher_fit() in place of fisher.alpha() and fisherfit() commands.


Renamed from fisher.aplha() and restores calculation of se and allows profiling.


Renamed from fisherfit(), which allows se calculations and profiling using the following commands restored from vegan 1.17.12.


My Publications

R Tips & Tricks
Writer's Bloc
An Introduction to R

The R Project Homepage

Follow me...
Facebook Twitter Google+ Linkedin Amazon
Top DataAnalytics Home
Contact GardenersOwn Homepage