A canonical function for creating plots within evalcast

plot_canonical(
  df,
  x,
  y,
  facet_rows = NULL,
  facet_cols = NULL,
  grp_vars = "forecaster",
  aggr = mean,
  dots = TRUE,
  lines = TRUE,
  base_forecaster = NULL,
  scale_before_aggr = FALSE
)

Arguments

df

dataframe containing the data to plot

x

Name of the variable in df to be used for the x-axis

y

name of the variable in df to be used for the y-axis

facet_rows

A variable name to facet data over. Creates a separate row of plots for each value of specified variable. Can be used with facet_cols to create a grid of plots.

facet_cols

Same as facet_rows, but with columns.

grp_vars

The set of variable names in df which to aggregate over. "forecaster" by default.

aggr

function to use to aggregate data over grp_vars

dots

when set to TRUE, a dot layer is included in the plot

lines

when set to TRUE, a line layer is included in the plot

base_forecaster

If set, scales the y-value for all forecasters by the corresponding values of the base_forecaster

scale_before_aggr

If TRUE, scales results by the base_forecaster before aggregating by the aggr function. FALSE by default.