profit_graph {SeaVal}R Documentation

(Accumulative) profit graphs

Description

These graphs really only make sense if you have 50 or less observations. Typical application would be when you compare seasonal mean forecasts to station data for a single location.

Usage

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

Arguments

dt

Data table containing tercile forecasts

accumulative

Logic. Should the accumulative profit be plotted or the profit per forecast?

f

column names of the prediction columns

o

column name of the observation column

by

column names of grouping variables. Default is NULL.

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.

Value

A list of gg objects which can be plotted by ggpubr::ggarrange (for example)

Examples

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)
p1 = profit_graph(dt)
p2 = profit_graph(dt,accumulative = FALSE)

if(interactive()){
plot(p1)
plot(p2)
}


[Package SeaVal version 1.1.1 Index]