Description Usage Arguments Value Examples
View source: R/Price_FUNCTIONS.R
Take two separate community lists and create a single data set, which is ready for calculating the Price Equation partitions.
1 | data.setup(input, aggregate = "sum")
|
input |
Data on the composition of a pair of communities. This can take on two different forms: (i) a single data frame, where the first column is 'species', a list of taxa names, and the following two columns list the function of each species in communities X and Y. Species absent from one community are given an entry of 0 function. (ii) a list of two separate data frames, one for each community X and Y, each containing two columns, and the corresponding function of each species. |
aggregate |
A rule for aggregating multiple entries for the same species. The default option is "sum", a secondary option is "mean" |
A data frame of species identities and functions, appropriately formatted for running price partition calculations.
species |
A list of species names |
func.X |
The function of each species in communityX |
func.Y |
The function of each species in community Y |
wvec |
An indicator variable equal to 1 when a species occurs in both X and Y |
xvec |
An indicator variable equal to 1 when a species occurs in X |
yvec |
An indicator variable equal to 1 when a species occurs in Y |
1 2 3 4 5 6 7 8 | # Method 1:
data.setup(list(biomass))
# Method 2:
comX <- biomass[biomass$biomassX!=0,c('species','biomassX')]
comY <- biomass[biomass$biomassY!=0,c('species','biomassY')]
data.setup(list(comX,comY))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.