Learn R Programming

SeaVal (version 1.1.1)

tendency_diag: Tendency diagram from a data table containing tercile forecasts.

Description

Tendency diagram from a data table containing tercile forecasts.

Usage

tendency_diag(
  dt,
  f = c("below", "normal", "above"),
  o = tc_cols(dt),
  by = NULL,
  pool = setdiff(dimvars(dt), by),
  dim.check = TRUE
)

Value

If by == NULL a gg object, otherwise a list of gg objects that can be plotted by ggpubr::ggarrange (for example)

Arguments

dt

Data table containing tercile forecasts

f

column names of the prediction columns

o

column name of the observation column

by

column names of grouping variables. Default is to not group.

pool

column names of pooling variables (used for the dimension check). Default is all dimvars.

dim.check

Logical. If TRUE, the function checks whether the columns in by and pool span the entire data table.

Examples

Run this code
dt = data.table(below = c(0.5,0.3,0),
                normal = c(0.3,0.3,0.7),
                above = c(0.2,0.4,0.3),
                tc_cat = c(-1,0,0),
                lon = 1:3)
print(dt)
pp = tendency_diag(dt)
if(interactive()) plot(pp)

Run the code above in your browser using DataLab