R code for the sampling effect model.
Ecological Archives E090-057-S1.
Authors
File list (downloads)
Description
Daniel J. McGlinn
Botany Department
Oklahoma State University
117 Life Sciences East
Stillwater, OK 74078
E-mail: [email protected]Michael W. Palmer
Botany Department
Oklahoma State University
116 Life Sciences East
Stillwater, OK 74078
E-mail: [email protected]
STAR_samp_model.R - R code for sampling effect model
The file STAR_samp_model.R is a script file that can be opened in a text editor or within the R program interface. R is a free open source program for statistical analysis that can be downloaded at the following site: http://cran.r-project.org/. This script is provided such that the user can recreate the patterns that were documented and discussed in the manuscript as well as explore other possible parameterizations of the sampling model. Instructions to the user are demarcated in the code by the “#” symbol.
The first part of the script defines the size of the species pool:“S” and the different relative abundance distributions (RADs) to be used. Each individual RAD will be assigned to a single column of the matrix,“P.mat”. Two graphical routines are provided to examine the RADs chosen: a rank log-abundance plot and a cumulative probability plot. Next the number of different areas and times the model should be calculated for are defined, this is specified by the variable “ncurves”. Also the different values for the replacement rate, “R”, are defined at this time. Next the two main routines that run the sampling model algorithm are provided. The first algorithm calculates average richness, z, and w values for each combination of a particular value of area, time, R, and RAD. These values will be assigned to the arrays “ExpS”, “Z”, and “W” respectively. The second algorithm calculates the time-by-area interaction array, “U”. The time-by-area interaction was calculated in a separate routine because computation time can be long and we wanted to provide the user the choice of calculating this array or not. Lastly the script provides a variety of graphical procedures for examining the results of the sampling effect model. To generate color figures identical to those displayed in Appendix C the R package “dichromat” must be downloaded from CRAN and loaded into the R interface to create the color scheme.
Specifically the script was using R v2.6.2. However, the routines should be reliable in future or past versions of this software.
ESA Publications | Ecological Archives | Permissions | Citation | Contacts