partition_parallel: Partitioning Diversity

Description Usage Arguments Details Value Examples

View source: R/partitionFunctionsPARALLEL.R

Description

partition_parallel is A BETA TEST ONLY. partition is used to calculate alpha, beta, and gamma diversity of both balanced and unbalanced designs. It can be used to carry out diversity partitioning at both single and multiple scales, as well as nested designs. partition can run hypothesis testing based on distributions generated from two randomizations methods (see below). THIS VERSION OF THE CODE IS A TEST. STILL CHECKING TO SEE IF IT GIVES SIMILAR OUTPUT OF THE partition FUNCTION. PARALLEL PROCESSING ALLOWS FOR MUCH FASTER ANALYSES AND RUNTIME.

Usage

1
2
partition_parallel(sp, h.level, low.level = 1, q = 0,
  hyp.test = "INDIVIDUAL", sim.rand = 1000)

Arguments

sp

Data frame containing a species matrix that includes variables coding for the different scales by which diversity is to be partitioned. The columns containing levels by which diversity is to be partitioned must be of class factor.

h.level

Vector or list containing column names coding for the different scales by which diversity is to be partitioned. These must be in increasing scale.

low.level

Integer representing the lowest level of diversity to be partitioned. This is the lowest ecologically relevant level. Defaults to 1. Must be >1 when hyp.test = "SAMPLE".

q

Integer representing Hill Number q-diversity metrics. 0 represents species richness; 1 represents Shannon-diversity; and 2 represents Simpsons-diversity. See Jost (2007) for more information.

hyp.test

Method of hypothesis testing to be used; for hypothesis testing: hyp.test = "INDIVIDUAL" and hyp.test = "SAMPLE"; for calculation of observed values only: hyp.test = "NONE".

sim.rand

Integer representing the number of randomizations to be run for hypothesis testing; defaults to 1000. If hyp.test = "NONE", sim.rand can be ignored.

...

further arguments passed to or from other methods

Details

Diversity partitioning is a method of decomposing a total amount of diversity (gamma - γ) into the components of mean diversity within samples (alpha - α) and diversity among samples (beta - β). It can be used with a wide variety of diversity metrics, specifically the Hill Number q-diversity metrics (Jost 2007). γ and α are calculated using equations 3 - 6 of Chao et al. (2012), with equations 5 and 6 used when q = 1 and equations 3 and 4 used in all other cases.

The partition function can be applied to a variety of data sets, including those with an unbalanced sampling design, substantial variation in the number of individuals within those samples, and hierarchical sampling designs (multiple nested levels).

partition calculates alpha and beta diversity and uses randomization to derive expected values of alpha and beta diversity that would be obtained if individuals (INDIVIDUAL) or samples (SAMPLE) were randomly distributed. This randomization allows for significance testing of the observed diversity estimates. The statistical rationale and operational description of INDIVIDUAL- and SAMPLE-based randomization can be found in Crist et al. (2003).

The partition function is the R equivalent of the PARTITION software developed by Crist et al. (2003).

At the highest sampling level (h), the diversity components are calculated as follows:

Additive: β (h) = γ - α (h)

Multiplicative: β (h) = γ / α (h)

For the lower sampling levels calculated as follows:

Additive: β (i) = α (i+1) - α (i)

Multiplicative: β (i) = α (i+1) / α (i)

Value

An object of class "partition". This object is a list of data frames. Calling an object of class "partition" will print the $Div and $Hyp data frames; these data frames contain the partitioned data and p-values from significance tests, respectively. For more information from the object and interpretations of significance tests, please use the summary.partition function.

$Div

observed partitioned diversity

$Hyp

p-values from significance testing

$Rand.Beta.Add

expected additive Beta diversity

$Rand.Beta.Mult

expected multipicative Beta diversity

$Rand.Alpha

expected alpha diversity at the lowest ecologically important level (set by low.level)

$Test

"INDIVIDUAL", "SAMPLE", or "NONE" - set by hyp.test, passed to object to be used in support and generic functions

$q

integer set by q, passed to object to be used in support and generic functions

$Randomizations

integer set by sim.rand, passed to object to be used in support and generic functions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
part.obj <- partition_parallel(sp = spiders.spp,
                      h.level = c("SAMPLE", "TREESP"),
                      low.level = 1,
                      q = 0,
                      hyp.test = "INDIVIDUAL",
                      sim.rand = 1000)

print(part.obj)

## End(Not run)

partitionr/PARTITIONR documentation built on Dec. 3, 2019, 11:11 p.m.