Description Usage Arguments Value See Also
Creates a binary frequency histogram table by computing the proportion of records for which a selected column has a given value (in this study, the percentage length of rivers that are deemed intermittent) after binning the table by a continuous variable (e.g. river discharge).
| 1 2 3 4 5 6 7 8 9 10 11 | formathistab(
  in_dt,
  castvar,
  valuevar,
  valuevarsub,
  weightvar = 1,
  binfunc,
  binarg,
  binlabels,
  datname = NULL
)
 | 
| in_dt | data.table to bin. | 
| castvar | (character) olumn that will be used to define bins —
the equivalent of  | 
| valuevar | (character) variable to summarize (e.g. intermittency class). | 
| valuevarsub | (character) value of  | 
| weightvar | (character) variable to weigh proportion by. (e.g. river reach length). | 
| binfunc | (character) binning approach. One of 'manual', 'equal_length', 'equal_freq'. | 
| binarg | (numeric) binning argument, depends on binning approach ( | 
| binlabels | (character vector) formatted labels for bins. | 
| datname | (character) optional, adds a column to output table describing what the data describes (e.g. France) | 
data.table with five columns:
bin - bin number
 perc - percentage of records (or of weightvar) that meet valuevar == valuevarsub.
 binsumlength - number of records (if default weightvar) or sum of weightvar by bin (e.g. total river length).
 dat - datname argument
 binformat - label for each bin provided through binlabels argument
used in compare_fr, compare_us,
and compare_au
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.