calc_regionwise_ensemble: Assign to cells the inverse-ecdf quantiles from region-wide...

Description Usage Arguments See Also

View source: R/calculate_ensemble.R

Description

For each region, the function calc_extentwise_ensemble is called on the set of cells belonging to that region.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
calc_regionwise_ensemble(
  SFSW2_prj_meta,
  data,
  subset = NULL,
  region,
  area = NULL,
  fcentral = c("median", "mean"),
  funs = c("min", "median", "max"),
  probs = c(0, 0.5, 1),
  ...,
  ties.method = "first",
  variables = NULL,
  add_historic = TRUE,
  reqCSs = NULL,
  verbose = FALSE
)

Arguments

data

A data.frame with three dimensions – as generated by extract_dbOut_to_array.

subset

A logical vector used to subset gridcells from data for calculation of ensemble.

region

A character or numeric vector of a length equal to the first dimension of data, i.e., cells.

area

A numeric vector. Its length corresponds to the first dimension of data and represents the cell areas (e.g., that may vary by latitude). If not NULL or not all equal, then a fcentral value "mean" uses weighted.mean instead of mean and a value of "median" uses wtd.quantile instead of median where area are used as non-random "reliability" weights.

fcentral

A character string naming the function to calculate a central tendency across the spatial extent for each GCMs; one of "mean" or "median". The function is used to calculate the region-wide (weighted) statistic on which the GCMs are ranked. See area.

funs

A vector of character strings or of functions. The functions of the form f(x, ...) which will be used to calculate the ensemble values across GCMs. Note: "min", "median", "max" will be replaced by their quantile equivalents, i.e., probs = 0, 0.5, or 1 respectively.

probs

A numeric vector of probabilities with values in [0,1] to determine which quantiles from among the fcentral values across GCMs are returned for each cell.

...

Optional arguments passed to quantile, e.g., na.rm = TRUE.

ties.method

A character string. Specifies how ties are treated. See link[base]{rank}. The method must produce unique ranks if funs or probs are not empty.

variables

A vector of character strings. A subset of names of the second dimension of data or NULL which indicates to use the full set of the second dimension of data.

reqCSs

A vector of character strings. A subset of (climate) scenarios from SFSW2_prj_meta[["sim_scens"]][["reqCSs"]] for which ensembles are calculated.

verbose

A logical value.

See Also

calc_extentwise_ensemble


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