profit_graph | R Documentation |
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.
profit_graph(
dt,
accumulative = TRUE,
f = c("below", "normal", "above"),
o = tc_cols(dt),
by = NULL,
pool = setdiff(dimvars(dt), by),
dim.check = TRUE
)
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. |
A list of gg objects which can be plotted by ggpubr::ggarrange (for example)
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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.