Title: | Paleoecology Functions for Regime Shift Analysis |
---|---|
Description: | Contains a variety of functions, based around regime shift analysis of paleoecological data. Citations: Rodionov() from Rodionov (2004) <doi:10.1029/2004GL019448> Lanzante() from Lanzante (1996) <doi:10.1002/(SICI)1097-0088(199611)16:11%3C1197::AID-JOC89%3E3.0.CO;2-L> Hellinger_trans from Numerical Ecology, Legendre & Legendre (ISBN 9780444538680) rolling_autoc from Liu, Gao & Wang (2018) <doi:10.1016/j.scitotenv.2018.06.276> Sample data sets lake_data & lake_RSI processed from Bush, Silman & Urrego (2004) <doi:10.1126/science.1090795> Sample data set January_PDO from NOAA: <https://www.ncei.noaa.gov/access/monitoring/pdo/>. |
Authors: | Alex H. Room [aut, cre, cph] , Felipe Franco-Gaviria [ctb, fnd] , Dunia H. Urrego [ctb, fnd] , The authors of the dependency Rust crates [ctb] (see inst/AUTHORS file for details) |
Maintainer: | Alex H. Room <[email protected]> |
License: | MIT + file LICENSE |
Version: | 3.1.1 |
Built: | 2024-12-24 06:58:49 UTC |
Source: | CRAN |
Converts absolute abundance data to a percentage of total abundance for each site
absolute_to_percentage(data, col, site)
absolute_to_percentage(data, col, site)
data |
The dataframe to be used. |
col |
The column that change is being measured on. |
site |
The column containing the site of each sample. |
The ‘data' dataframe with an added ’percentage' column.
Hellinger transforms data (Legendre and Legendre, Numerical Ecology)
Hellinger_trans(data, col, site)
Hellinger_trans(data, col, site)
data |
The dataframe to be used. |
col |
The column that change is being measured on. |
site |
The column containing the site of each sample. |
The ‘data' dataframe with an added ’hellinger_trans_vals' column.
A dataset containing January PDO values. Subset of the data from NOAA: <https://www.ncei.noaa.gov/access/monitoring/pdo/>.
data(January_PDO)
data(January_PDO)
A data frame with 104 rows and 2 variables
PDO - Pacific Decadal Oscillation in January for the given year.
Age - the year for which the PDO was measured.
A dataset containing pre-processed DCA-ordinated data from Bush, Silman & Urrego (2004) <doi:10.1126/science.1090795>.
data(lake_data)
data(lake_data)
A data frame with 39 rows and 2 variables
DCA1 - DCA values for each timepoint from the raw dataset.
Age - timepoint of each sample that has been DCA-ordinated.
A dataset containing pre-processed DCA-ordinated data from Bush, Silman & Urrego (2004) <doi:10.1126/science.1090795>. This data has been processed using Rodionov(lake_data, "DCA1", "Age", l=5, merge=TRUE)
data(lake_RSI)
data(lake_RSI)
A data frame with 39 rows and 3 variables
DCA1 - DCA values for each timepoint from the raw dataset.
Age - timepoint of each sample that has been DCA-ordinated.
RSI - Regime Shift Index (see docs for Rodionov()) for each timepoint.
performs the L-method for detection of regime shifts (Lanzante, 1996)
Lanzante(data, col, time, p = 0.05, merge = FALSE)
Lanzante(data, col, time, p = 0.05, merge = FALSE)
data |
The dataframe to be used. |
col |
The column we are measuring change on. |
time |
The column containing time units (e.g. age of a subsample) |
p |
The largest p-value you want to check regime shifts for. Defaults to p = 0.05. |
merge |
Sets the result to be either a regime-shift only table (if FALSE), or an addition to the original table (if TRUE) |
If merge = FALSE (default), produces a 2-column table of time (the time value for each regime shift) and p (the p-value for each regime shift). If merge = TRUE, returns the original dataset with an extra p-value column, giving the p-value for each time unit - 0 for non-shift years.
Lanzante(lake_data, "DCA1", "Age") Lanzante(lake_data, "DCA1", "Age", p=0.10, merge=TRUE)
Lanzante(lake_data, "DCA1", "Age") Lanzante(lake_data, "DCA1", "Age", p=0.10, merge=TRUE)
calculates the mean for each regime in a regime shift analysis.
regime_means(data, col, rsi)
regime_means(data, col, rsi)
data |
The dataframe that will be used. |
col |
The column we are measuring change on. |
rsi |
The column containing RSI values. |
A vector of the mean value for each regime.
regime_means(lake_RSI, "DCA1", "RSI")
regime_means(lake_RSI, "DCA1", "RSI")
performs STARS analysis (Rodionov, 2004) on a dataset
Rodionov(data, col, time, l, prob = 0.05, startrow = 1, merge = FALSE)
Rodionov(data, col, time, l, prob = 0.05, startrow = 1, merge = FALSE)
data |
The dataframe to be used. |
col |
The column we are measuring change on. |
time |
The column containing time units (e.g. age of a subsample) |
l |
The cut-off length of a regime; affects sensitivity (see Rodionov, 2004) |
prob |
The p-value for significance of a regime shift. Defaults to p = 0.05. |
startrow |
What row the analysis starts at. Defaults to 1. |
merge |
Sets the result to be either a regime-shift only table (if FALSE), or an addition to the original table (if TRUE) |
If merge = FALSE (default), produces a 2-column table of time (the time value for each regime shift) and RSI (the regime shift index for each regime shift). If merge = TRUE, returns the original dataset with an extra RSI column, giving the regime shift index for each time unit - 0 for non-shift years.
Rodionov(lake_data, "DCA1", "Age", l=5) Rodionov(lake_data, "DCA1", "Age", l=5, prob=0.01, startrow=2, merge=TRUE)
Rodionov(lake_data, "DCA1", "Age", l=5) Rodionov(lake_data, "DCA1", "Age", l=5, prob=0.01, startrow=2, merge=TRUE)
finds lag-1 autocorrelation in a rolling window; can be used to predict resilience (Liu, Gao, & Wang, 2018)
rolling_autoc(data, col, l)
rolling_autoc(data, col, l)
data |
The dataframe that will be used. |
col |
The column we are measuring change on. |
l |
The time interval (no. of columns) used in the autocorrelation. |
A table of rolling lag-1 autocorrelation values.
creates two graphs, one of data and one of the RSI, as seen in Rodionov (2004)
RSI_graph(data, col, time, rsi, mean_lines = FALSE)
RSI_graph(data, col, time, rsi, mean_lines = FALSE)
data |
The dataframe that will be used. |
col |
The column we are measuring change on. |
time |
The column containing time units (e.g. age of a subsample) |
rsi |
The column containing RSI values (for best visualisation use Rodionov() with merge=TRUE) |
mean_lines |
If true, add lines over the data indicating the mean of each regime. |
Two graphs, one on top of the other; one of col against time and one of RSI against time.
RSI_graph(lake_RSI, "DCA1", "Age", "RSI")
RSI_graph(lake_RSI, "DCA1", "Age", "RSI")
Calculates the mean for each regime in a regime shift analysis.
rust_regime_means(col, rsi)
rust_regime_means(col, rsi)
col |
The column we are measuring change on. |
rsi |
The column containing RSI values. |
Calculate STARS RSI points and return to R as a vector
rust_rodionov(vals, t_crit, l)
rust_rodionov(vals, t_crit, l)
vals |
The column we are measuring change on |
t_crit |
The critical value of a t-distribution at the desired p-value |
l |
The cut-off length of a regime; affects sensitivity |