This package contains code for several species association metrics and analyses that I used in paper "Measurement and analysis of interspecific spatial associations as a facet of biodiversity" by Petr Keil, Thorsten Wiegand, Aniko B. Toth, Daniel J. McGlinn & Jonathan M. Chase.
Majority of functions in this package have more mature counterpars in other existing packages. 'spasm' is more of an assortment of code and wrappers that I needed for a review of species association metrics, and putting the code to the form of a package is my way of understanding, organizing, and documenting the code.
The existing packages that may do the same or better job than spasm
are:
EcoSimR
for cooccurrence analysis and null models.spatstat
for point pattern analysis, pair correlation functions, and K functions.vegan
for dissimilarities, and all sorts of association indices.vario
for community variograms.Before using a spasm
function, please have a look at these packages - they may
do what you need in a more standard way.
To install the latest version of spasm, the easiest way
is using the install_github
function from
the devtools
package:
library(devtools)
install_github("petrkeil/spasm")
Alternatively, you can also download the .zip file, extract it, and then run the following command in the terminal from within the folder that contains the extracted spasm sub-folder:
R CMD build spasm
spasm
contains:
These are all analyses that were done in the paper.
They are located in the analyses
sub-folder, and
contain the comparison of ISA metrics on empirical data, comparison of ISA metrics
on simulated data, and analyses of data obtained by literature search.
These are located in the data
sub-folder, and also load as a part of the package
when library(spasm)
is executed. All of the data objects have data.
prefix in
their name.
These are functions whose names begin with C_
. A typical example is Stone & Roberts'
C-score.
Names of these functions begin with CA_
.
So far these are not provided here, but in Dan McGlinn's package vario
here.
The following methods are implemented, togehter with their respective null models:
The implementation relies heavily on existing spatstat
functions.
Spasm "re-packages" some example data and their source should be credited, if these data are re-used. Specifically:
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.