calc_change_from_reference: Calculate absolute or relative change in response variables

Description Usage Arguments Details Value

View source: R/calculate_change.R

Description

Change in response variables between a climate reference condition (or scenario family) and each climate condition is calculated as

Usage

1
2
3
4
5
6
7
calc_change_from_reference(
  data,
  ref_condition,
  sc_hist = NULL,
  method = c("absolute", "relative", "direction", "rdirection"),
  ...
)

Arguments

data

A four-dimensional numerical array with dimensions runsN_sites, variables, scenarios, and experiments, e.g., the returned object from extract_dbOut_to_array.

ref_condition

A vector of character strings. Each element is used as reference to calculate a separate set of change values.

sc_hist

A character string. The name of the historical scenario that is the same for each other (future) projection; or NULL.

method

A character string. See description.

...

Additional arguments, e.g.,

tol

two-sided tolerance in relative units to identify "no change" for method == "direction" and method == "rdirection"

subset

a logical vector of length runsN_sites used by method == "rdirection" to identify "no change"

Details

If reference is the same for each scenario, e.g., "current", then the same value is used for each condition k; if reference is a scenario family, e.g., "RCP45", then the appropriate x values per GCM are used.

Value

A list of four-dimensional numerical array with dimensions runsN_sites, variables, scenarios, and experiments; each element is named as delta_ref_met where ref is one of ref_condition and met is the first three letters of method and the value of tol if provided.


DrylandEcology/rSW2analysis documentation built on Nov. 8, 2021, 4:20 p.m.