CompositeTrend: CompositeTrend function

Description Usage Arguments Details Value

View source: R/CompositeTrend.R

Description

This function can be used to produce composite metrics of change (indicators), whilst propagating uncertainty in the individual species trend estimates through to the final composite trend metric. This function takes in a dataframe of sampled annual occupancy estimates across multiple species and returns a a single composite trend metric with uncertainty. This approach is only suitable for species without missing years.

Usage

1
2
3
4
5
6
7
8
9
CompositeTrend(
  indata,
  output_path,
  trend_choice = "arithmetic_logit_occ",
  group_name,
  save_iterations = "yes",
  TrendScale = NULL,
  plot_output = TRUE
)

Arguments

indata

The file path to an .rdata file containing a dataframe (called samp_post - GP to change this) which contains year columns (prefixed with "X", e.g "X1985"), a species column ("species"), and an iteration identifier ("iter"). The year columns contain the annual occupancy estimates for the species-year-iteration combination in question.

output_path

The location where the outputs should be saved.

trend_choice

The approach used to combine the individual species estimates into a single composite trend. See details.

group_name

The name of the species group we are running, used for naming output files.

save_iterations

Do we want to save the composite trend estimates for each individual iteration, these are generally used for estimating temporal trends with uncertainty.

TrendScale

Traditionally some indicators are scaled so the first year is set to a given number, 100 in the case of the UK biodiversity indicators. This value can be chosen here, with no scaling as the default.

plot_output

plot the resulting composite indicator: TRUE or FALSE.

Details

There are a number of model to choose from:

Value

A summary file. This .csv is saved in the output_path location and contains the annual composite indicator estimate (summarized across the iterations as wither the mean or median). The unique number of species contributing to the indicator is shown in the "spp_num" column. Various forms of uncertainty (estimated across the iterations) for the annual composite trend are presented, including the upper and lower 95


GPowney/TrendSummaries documentation built on Nov. 15, 2021, 6:14 p.m.