tabulate_globalsummary: Tabulate global summary

Description Usage Arguments Details Value

Description

Create a summary table of the predicted prevalence of IRES across continuous size classes and categorical classes.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
tabulate_globalsummary(
  outp_riveratlaspred,
  inp_riveratlas,
  inp_riveratlas_legends,
  idvars,
  interthresh,
  castvar,
  castvar_num = TRUE,
  weightvar,
  valuevar,
  valuevarsub,
  binfunc = NULL,
  binarg = NULL,
  bintrans = NULL,
  na.rm = T,
  tidy = FALSE,
  nolake = TRUE,
  mincutoff = 0
)

Arguments

outp_riveratlaspred

(character) full path to .csv table containing flow intermittence predictions for global river network

inp_riveratlas

(character) full path to .csv. table containing attributes for global river network

inp_riveratlas_legends

(character) full path to .xlsx table containing metadata on river atlas attributes (meaning of category acronyms and codes e.g., for land cover)

idvars

(character) name of the variable (usually categorical) whose categories to use for producing summary statistics of flow prevalence (e.g., climate or country)

interthresh

(numeric) flow intermittence probability threshold above which to classify records as non-perennial.

castvar

(character) name of the column that will be used to define bins/table columns (e.g., discharge) — the equivalent of binvar in bin_dt.

castvar_num

(boolean) whether casting column (castvar) is a numeric (used for sorting properly).

weightvar

(character) variable to weigh proportion by (e.g. river reach length).

valuevar

(character) variable to summarize (e.g. intermittency class).

valuevarsub

(character) value of valuevar to summarize (e.g. '1' for intermittent rivers)

binfunc

(character) binning approach. One of 'manual', 'equal_length', 'equal_freq'. See bin_dt.

binarg

(numeric) binning argument, depends on binning approach. See bin_dt.

bintrans

(character or numeric) transformation of binvar, default is NULL.

na.rm

(logical) whether to include NAs.

tidy

(boolean) whether to keep in tidy long form (TRUE) or to cast into formatted shape (FALSE; i.e., idvars as rows and castvar as columns + a world row)

nolake

(boolean) whether to include sections of river reaches that intersect lakes (FALSE) or not (TRUE)

mincutoff

(numeric) smallest river reaches to include in computation, in terms of long-term mean annual flow (m3/s; e.g., 0.1)

Details

this function is used to produce Table 1 in Main Text, Extended Data Figure 1c, and Supplementary Data tables from Messager et al. (2021).

bintrans can either be 'log' (for natural log) or a numeric exponent to transform according to x^bintrans.

Value

data.table


NaiaraLopezRojo/globalIRmap documentation built on Dec. 17, 2021, 5:19 a.m.