Description Usage Arguments Value Author(s) Examples
View source: R/dataManipulation.R
match.spacodi.data
is a utility for automating the process of pruning datasets for use in spacodiR. Note that nearly all spacodiR functions require that
trees have present (at least) all species sampled in the community dataset.
1 | match.spacodi.data(sp.plot, phy=NULL, sp.traits=NULL, prune=TRUE, verbose=FALSE)
|
sp.plot |
a community dataset in spacodiR format (see |
phy |
a phylogenetic tree of class |
sp.traits |
a species-by-trait(s) dataframe |
prune |
Boolean; whether plots with fewer than two species sampled are pruned |
verbose |
Boolean; whether dropped plots are written to the console |
A list of pruned dataset(s):
sp.plot
sp.tree
sp.traits
Note: if prune=TRUE
, the list of plots pruned will be printed to the console.
Jonathan Eastman
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # load a species-by-plots matrix, along with a tree
data(sp.example)
attributes(sp.example)
attach(sp.example)
spl
phy
trt
# prune out undersampled plots
spl[,2]=0
match.spacodi.data(spl) -> sp.plot.new
sp.plot.new
# match datasets where sp.traits is smaller than the remainder
match.spacodi.data(sp.plot=spl, phy=phy, sp.traits=trt[1:6,])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.