This page gives the code and instructions for Nick Matzke's R-and-Biogeography workshop session at the "Methodological Workshop On Biodiversity Dynamics", on May 26 at the SI meeting "Evolution of Life on Pacific Islands and Reefs: Past, present, and future"
In the workshop, I gave 2 demos:
- A simple example of a maximum likelihood search for estimating the relative probability of lineages changing geographic range, precipitation preference, and elevation preference
- A demo showing how GIS, GBIF, and phylogenetics can be integrated in R.
These were both meant as "for instance" demos, to give users a taste of what you can do with R, and, hopefully, the ability to get the basic code running themselves. They are not meant to be complete analyses by themselves.
Please contact Nick Matzke (matzkeATberkeley.edu) for questions/comments/collaborations.
Background in R
R is a free download, available here: http://cran.r-project.org/
If you are starting R totally from scratch, I recommend the tutorial I wrote for U.C. Berkeley's IB200B: Phylogenetics - Ecology & Evolution course.
In particular, the Feb. 3 lab, "Introduction to R". See the R books and files linked from there. For the code, go to: LAB #3: Introduction to R.
Demo #1: ML search for relative probability of lineage changing geographic zone, precipitation zone, and elevation zone (3 binary, discrete categories)
The script is: _biogeog_workshop_ML_search_v2.R. There are no necessary files except the utility scripts, which can be remotely sourced (shown in the script) or downloaded from here: http://ib.berkeley.edu/courses/ib200b/labs/_code/
Demo #2: Integrating GIS, GBIF, and phylogenetics
The script is: _biogeog_workshop_GIS_v4.R. Getting it to work requires:
- Installing the GDAL library on your computer (see/use: _biogeog_workshop_GIS_v3_installation.R)
- Installing the RGDAL package in R (see/use: _biogeog_workshop_GIS_v3_installation.R)
- Downloading the GIS data files from here: http://ib.berkeley.edu/courses/ib200b/labs/_code/GIS_phylo_data/
- Setting the R working directory (command: setwd("directory_string_here") ) so that R sees your data files.