multivariate_change: Using dissimilarity-based measures to calculate changes in...

Description Usage Arguments Value References Examples

View source: R/multivariate_change_and_difference.R

Description

Calculates the changes in composition and dispersion based off a Bray-Curtis dissimilarity matrix. Composition change is the pairwise distance between centroids of compared time periods and ranges from 0-1, where identical communities give 0 and completely different communities give 1. Dispersion change is the difference between time periods in the dispersion of replicates, i.e. the average distance between a replicate and its centroid.

Usage

1
2
3
4
5
6
7
8
9
multivariate_change(
  df,
  time.var,
  species.var,
  abundance.var,
  replicate.var,
  treatment.var = NULL,
  reference.time = NULL
)

Arguments

df

A data frame containing time, species, abundance and replicate columns and an optional column of treatment.

time.var

The name of the time column.

species.var

The name of the species column.

abundance.var

The name of the abundance column.

replicate.var

The name of the replicate column. Replicate identifiers must be unique within the dataset and cannot be nested within treatments or blocks.

treatment.var

The name of the optional treatment column.

reference.time

The name of the optional time point that all other time points should be compared to (e.g. the first year of data). If not specified, each comparison is between consecutive time points (the first and second year, second and third year, etc.)

Value

The multivariate_change function returns a data frame with the following attributes:

References

Avolio et al. 2015; Avolio et al. Submitted, Marti Anderson et al. 2006.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
data(pplots)
# With treatment
multivariate_change(pplots,
                    time.var="year",
                    replicate.var = "plot",
                    treatment.var = "treatment",
                    species.var = "species",
                    abundance.var = "relative_cover")
# In each year there are 6 replicates and there are 4 years of data for 3
# time comparisons, thus 24 total observations in each treatment.

# With treatment and reference year
multivariate_change(pplots,
                    time.var="year",
                    replicate.var = "plot",
                    treatment.var = "treatment",
                    species.var = "species",
                    abundance.var = "relative_cover",
                    reference.time = 2002)
# In each year there are 6 replicates and there are 4 years of data for 3
# time comparisons, thus 24 total observations in each treatment.

# Without treatment
df <- subset(pplots, treatment == "N1P0")
multivariate_change(df,
                    time.var="year",
                    replicate.var = "plot",
                    species.var = "species",
                    abundance.var = "relative_cover")
# In each year there are 6 replicates and there are 4 years of data for 3
# time comparisons, thus 24 total observations.

codyn documentation built on Dec. 1, 2020, 9:09 a.m.