sppVector: Species Vectors

Description Details Author(s) See Also Examples

Description

A grouping variable that gives an identity to the individuals in various analyses.

Details

Species vectors are the key concept behind a lot of spider's functionality. They are the method used to group data from individuals into species. It is important to note that "species" in this context can mean any cluster (real or otherwise) that is of interest. Populations, demes, subspecies and genera could be the taxa segregated by "species vectors".

The two characteristics of a species vector are UNIQUENESS between species and CONSISTENCY within them. R recognises differences of a single character between elements, leading to spider considering these elements to represent different species.

There is an easy way and a hard way to create species vectors. The hard way is to type out each element in the vector, making sure no typos or alignment errors are made.

The easy way is to add species designations into your data matrix from the beginning in such a way that it is easy to use R's data manipulation tools to create a species vector from the names of your data. See the examples for a few ways to do this.

Author(s)

Samuel Brown <s_d_j_brown@hotmail.com>

See Also

Functions for creating species vectors: strsplit, substr, sapply.

Functions that use species vectors: nearNeighbour, monophyly, nonConDist, nucDiag, rmSingletons, slideAnalyses, slideBoxplots, sppDist, sppDistMatrix, threshOpt.

Examples

1
2
3
4
5
6
7
8
data(dolomedes)
#Dolomedes species vector
doloSpp <- substr(dimnames(dolomedes)[[1]], 1, 5)

data(anoteropsis)
#Anoteropsis species vector
anoSpp <- sapply(strsplit(dimnames(anoteropsis)[[1]], split="_"), 
    function(x) paste(x[1], x[2], sep="_"))

spider documentation built on May 2, 2019, 7:31 a.m.