match.spacodi.data: pruning a tree to match datasets used in SPACoDi

Description Usage Arguments Value Author(s) Examples

View source: R/dataManipulation.R

Description

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.

Usage

1
match.spacodi.data(sp.plot, phy=NULL, sp.traits=NULL, prune=TRUE, verbose=FALSE)

Arguments

sp.plot

a community dataset in spacodiR format (see as.spacodi)

phy

a phylogenetic tree of class phylo; see read.tree

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

Value

A list of pruned dataset(s):

Note: if prune=TRUE, the list of plots pruned will be printed to the console.

Author(s)

Jonathan Eastman

Examples

 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,])
							

spacodiR documentation built on May 2, 2019, 8:26 a.m.