Skip to contents

Calculates change of the five aspects of rank abundance curves (richness, evenness, rank, species gains, and species losses) for a replicate between two time points.

Usage

RAC_change(
  df,
  time.var,
  species.var,
  abundance.var,
  replicate.var = NULL,
  reference.time = NULL
)

Arguments

df

A data frame containing time, species, and abundance columns and an optional columns of replicates.

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 optional replicate column. If specified, replicate must be unique within the dataset and cannot be nested within treatments or blocks.

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 `RAC_change()` function returns a data frame with a subset of the following columns: - **replicate.var**: A column that has same name and type as the replicate.var column, if `replicate.var` is specified. - **time.var**: A column with the specified `time.var` and a second column, with '2' appended to the name. Time is subtracted from time2. - **richness_change**: A numeric column that is the change in richness between the two time periods for a replicate divided by the total number of unique species in both time periods. A positive value occurs when there is an increase in species richness over time, and a negative value when there is a decrease in species richness over time. - **evenness_change**: A numeric column that is the change in evenness (measured with Evar) between the two time periods for a replicate. A positive value occurs when evenness increases over time, and a negative value when evenness decreases over time. - **rank_change**: A numeric column that is the absolute value of the average change in species ranks between the two time periods for a replicate divided by the total number of unique species in both time periods. Species that are not present in both time periods are given the S+1 rank in the sample it is absent in, where S is the number of species in that sample. - **gains**: A numeric column of the number of species that are present at time period 2 that were not present at time period 1 for a replicate divided by the total number of unique species in both time periods. This is equivalent to the `turnover()` function with `metric = "appearances"`. - **losses**: A numeric column of the number of species that are not present at time period 2 but were present at time period 1 for a replicate divided by the total number of unique species in both time periods. This is equivalent to the `turnover()` function with `metric = "disappearance"`.#' @references Avolio et al. Submitted

Examples

data(pplots)
# Without replicates
df <- subset(pplots, plot == 25)
RAC_change(df = df,
           species.var = "species",
           abundance.var = "relative_cover",
           time.var = "year")
#>   year year2 richness_change evenness_change rank_change      gains     losses
#> 1 2002  2003      -0.1500000     -0.05537606    0.145000 0.10000000 0.25000000
#> 2 2003  2004       0.2380952      0.04096495    0.122449 0.28571429 0.04761905
#> 3 2004  2005      -0.1904762     -0.05519765    0.106576 0.04761905 0.23809524

# With replicates
df <- subset(pplots, year < 2004 & plot %in% c(6, 25, 32))
RAC_change(df = df,
           species.var = "species",
           abundance.var = "relative_cover",
           replicate.var = "plot",
           time.var = "year")
#>   year year2 plot richness_change evenness_change rank_change gains losses
#> 1 2002  2003    6           -0.20     -0.07990473       0.120  0.08   0.28
#> 2 2002  2003   25           -0.15     -0.05537606       0.145  0.10   0.25
#> 3 2002  2003   32            0.04      0.05890419       0.128  0.20   0.16
           
# With reference year
df <- subset(pplots, year < 2005 & plot %in% c(6, 25, 32))
RAC_change(df = df,
           species.var = "species",
           abundance.var = "relative_cover",
           replicate.var = "plot",
           time.var = "year",
           reference.time = 2002)
#>   year year2 plot richness_change evenness_change rank_change     gains
#> 1 2002  2003    6     -0.20000000     -0.07990473   0.1200000 0.0800000
#> 2 2002  2003   25     -0.15000000     -0.05537606   0.1450000 0.1000000
#> 3 2002  2003   32      0.04000000      0.05890419   0.1280000 0.2000000
#> 4 2002  2004    6     -0.03571429      0.02686011   0.1683673 0.1785714
#> 5 2002  2004   25      0.08333333     -0.01424465   0.1302083 0.2500000
#> 6 2002  2004   32     -0.08333333      0.06876699   0.1493056 0.1666667
#>      losses
#> 1 0.2800000
#> 2 0.2500000
#> 3 0.1600000
#> 4 0.2142857
#> 5 0.1666667
#> 6 0.2500000