Skip to content

Commit

Permalink
Fix spelling errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbjones committed Apr 9, 2019
1 parent 14f3347 commit a5f969a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion R/multivariate_change_and_difference.R
Expand Up @@ -151,7 +151,7 @@ multivariate_change <- function(df,
#'
#' @inheritParams RAC_difference
#' @param df A data frame containing a species, abundance, replicate, and
#' treament columns and optional time column.
#' treatment columns and optional time column.
#' @param treatment.var The name of the treatment column.
#'
#' @return The multivariate_difference function returns a data frame with the
Expand Down
2 changes: 1 addition & 1 deletion man/multivariate_difference.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions vignettes/Community_Stability_Metrics.Rmd
Expand Up @@ -42,7 +42,7 @@ kable(head(knz_001d))


## Community stability
The `community_stability` function aggregates species abundances within replicate and time period, and uses these values to calculate community stability as the temporal mean divided by the temporal standard deviation [@tilman1999]. It includes an optional argument to calculate community stabilty across multiple replicates, which returns a data frame with the name of the replicate column and the stability value.
The `community_stability` function aggregates species abundances within replicate and time period, and uses these values to calculate community stability as the temporal mean divided by the temporal standard deviation [@tilman1999]. It includes an optional argument to calculate community stability across multiple replicates, which returns a data frame with the name of the replicate column and the stability value.
```{r results='asis'}
KNZ_stability <- community_stability(knz_001d,
time.var = "year",
Expand Down Expand Up @@ -122,7 +122,7 @@ kable(KNZ_A1_variance_ratio)

- `cyclic_shift` returns an S3 object of test statistics from a user-specified function when applied to a null community generated via a cyclic shift permutation. It requires a dataframe with a `species.var`, `time.var` and `abundance.var` column, and optional `replicate.var` column. The user-specified function should operate on a community matrix (e.g., `cov`).

The length of the "out" param in the object is the number of null iterations as specified by `bootnumber`). If multiple replicates are specified, null values are averaged among replicates for each interation, but a different cyclic shift permutation is applied to each replicate within an interation.
The length of the "out" param in the object is the number of null iterations as specified by `bootnumber`). If multiple replicates are specified, null values are averaged among replicates for each iteration, but a different cyclic shift permutation is applied to each replicate within an iteration.

- `confint` returns the confidence intervals from the S3 object produced by `cyclic_shift`.

Expand Down Expand Up @@ -171,7 +171,7 @@ $$ Synchrony = (1/N){{\sum_{i}Corr(x_i, \sum_{i\neq{j}}{x_j})}}$$
This measure of synchrony is standardized from -1 (perfect asynchrony) to 1 (perfect synchrony) and is centered at 0 when species fluctuate independently. A virtue of this metric is it not sensitive to richness and has the potential for null-model significance testing. It may under-perform on short time series because it is based on correlation, and care should be taken when applying it to communities that contain very stable species (i.e., whose abundances do not change throughout the time series).


In `codyn`, this metric is calculated with the `Gross` option in the `synchrony` function and can be easily calculated for multpile replicates in a dataset. If a species does not vary over the course of the time series `synchrony` will issue a warning and will remove that species from the calculation.
In `codyn`, this metric is calculated with the `Gross` option in the `synchrony` function and can be easily calculated for multiple replicates in a dataset. If a species does not vary over the course of the time series `synchrony` will issue a warning and will remove that species from the calculation.
```{r results='asis'}
KNZ_synchrony_Gross <- synchrony(df = knz_001d,
time.var = "year",
Expand Down
12 changes: 6 additions & 6 deletions vignettes/Temporal_Diversity_Indices.Rmd
Expand Up @@ -17,7 +17,7 @@ vignette: >
## Overview
Many measures of community structure, such as diversity indices and rank-abundance curves, represent "snapshots in time" - which do not capture the temporal dynamics of ecological systems. For example, species richness (i.e., the number of species present) is a common metric to characterize ecological communities. However, species richness may be a poor indicator of community change if there is turnover in the identity but not the number of species present over time [@Collins2008; @cleland2013]. Similarly, species rank abundances can reorder through time, even when the pool of species present remains relatively stable. Within-year rank abundance curves fail to capture this dynamic, and other tools are needed to quantify within-community reordering without masking informative temporal shifts in internal dynamics [@Collins2008]. `codyn` includes three functions to characterize temporal shifts in species identity and rank abundances over time:

- `turnover` calculates total turnover as well as the proportion of species that either appear or disappear between timepoints.
- `turnover` calculates total turnover as well as the proportion of species that either appear or disappear between time points.

- `rank_shift` quantifies relative changes in species rank abundances by taking the sum difference of species ranks in consecutive time points.
This metric goes hand-in-hand with "rank clocks," a useful visualization tool of shifts in species ranks.
Expand Down Expand Up @@ -49,7 +49,7 @@ Species turnover represents a temporal analog to species richness. It is describ
### Total turnover
The function `turnover` calculates three metrics of species turnover: total turnover, appearances, and disappearances.

The default metric `total` refers to total turnover, which calculates the proportion of species that differ between timepoints as:
The default metric `total` refers to total turnover, which calculates the proportion of species that differ between time points as:

$$ Total\; turnover = \frac{Species\; gained\; +\; Species\; lost}{Total\; species\; observed\; in\; both\; timepoints} $$

Expand Down Expand Up @@ -78,9 +78,9 @@ KNZ_turnover_agg <- turnover(df = collins08,

### Appearances and disappearances

Total turnover incorporates both species appearances and disappearances, but sometimes it is useful to parse their relative contribution. For example, a timepoint in which many species appear may reflect a different ecological story than a timepoint in which many species drop from the system, but the total turnover in both scenarios may be similar.
Total turnover incorporates both species appearances and disappearances, but sometimes it is useful to parse their relative contribution. For example, a time point in which many species appear may reflect a different ecological story than a time point in which many species drop from the system, but the total turnover in both scenarios may be similar.

Specifying `metric="appearance"` will return the proportion of species that appeared relative to the total number of species observed in both timepoints. As before, spatial replicates can be specified with the `replicate` argument; setting `replicate.var=NA` will calculate across the full dataset.
Specifying `metric="appearance"` will return the proportion of species that appeared relative to the total number of species observed in both time points. As before, spatial replicates can be specified with the `replicate` argument; setting `replicate.var=NA` will calculate across the full dataset.
```{r results='asis'}
KNZ_appearance <- turnover(df = collins08,
time.var = "year",
Expand All @@ -91,7 +91,7 @@ KNZ_appearance <- turnover(df = collins08,
```


Similarly, specifying `metric="disappearance"` will return the proportion of species that disappeared relative to the total number of species observed in both timepoints.
Similarly, specifying `metric="disappearance"` will return the proportion of species that disappeared relative to the total number of species observed in both time points.
```{r results='asis'}
KNZ_disappearance <- turnover(df = collins08,
time.var = "year",
Expand Down Expand Up @@ -180,7 +180,7 @@ ggplot(aggdat, aes(year, abundance, color = species)) +

### Mean rank shifts

The `rank_shift` function describes relative changes in species rank abundances, which indicate the degree of species reording between two time points. This metric is calculated as:
The `rank_shift` function describes relative changes in species rank abundances, which indicate the degree of species reordering between two time points. This metric is calculated as:

$$ MRS = {\sum_{i=1}^{N} (|R_i,t+1 - R_i,t|})/N $$

Expand Down
2 changes: 1 addition & 1 deletion vignettes/codyn_overview.Rmd
Expand Up @@ -16,7 +16,7 @@ vignette: >
As long-term datasets increase in scope and length, new analytical tools are being developed to capture patterns of species interactions over time. The package `codyn` includes recently developed metrics of ecological community dynamics. Functions in `codyn` implement metrics that are explicitly temporal, and include the option to calculate them over multiple replicates. Functions fall into two categories: temporal diversity indices and community stability metrics.

##Temporal Diversity Indices
Many traditional measure of community structure represent a snapshot in time whereas ecological communities are dynamic and many are experiencing directional change with time. The diversity indices in `codyn` are temporal analogs to traditional diversity indices such as richness and rank-abundance curves. They include:
Many traditional measure of community structure represent a 'snapshot in time' whereas ecological communities are dynamic and many are experiencing directional change with time. The diversity indices in `codyn` are temporal analogs to traditional diversity indices such as richness and rank-abundance curves. They include:

- `turnover` calculates total turnover as well as the proportion of species that either appear or disappear between timepoints.

Expand Down

0 comments on commit a5f969a

Please sign in to comment.