The quantiles are saved in/returned as a list with the following elements:
dt - A data table with quantiles for each level of by (not the same as the input-dt).
quantiles - the vector of quantiles that were used.
group - a data table containing the levels the quantiles are grouped over, e.g. all years the quantiles are calculated over.
data_col_name - the name of data_col, see below, so that you know what the quantiles actually were computed from.
description - the description string, if provided.
get_quantiles(
dt,
data_col = setdiff(names(dt), dimvars(dt))[1],
qqs = c(10, 20, 33, 67, 80, 90),
by = setdiff(dimvars(dt), c("year", "member")),
description = NULL,
save_file = NULL
)
Nothing if save_file is provided. Otherwise the list described above
Data table containing the data.
The name of the column in dt containing the data for which the quantiles are derived. By default the first column that is not a dimension variable is selected.
Vector of quantiles. If one of them is larger 1 they are interpreted as percent. Default is the quantiles used in the verification maps.
Column names in dt. Levels by which the quantiles are calculated
Optional description string.
Optional name of save file.