Create a bi-variate histogram of forecast, observation pairs
Source:R/harp_hexbin.R
bin_fcst_obs.Rd
Values of forecasts and observations are binned into bands whereby the
density of forecast, observation pairs for each bin is calculated. Under the
hood, the data are binned into hexagons using hexbin
.
Hexagons are used since they have symmetry with nearest neighbours unlike
square bins, and at plot time they are the polygon with the maximum number of
sides that tessellate.
Usage
bin_fcst_obs(
.fcst,
parameter,
groupings = "lead_time",
num_bins = 30,
show_progress = TRUE,
...
)
# S3 method for harp_det_point_df
bin_fcst_obs(
.fcst,
parameter,
groupings = "lead_time",
num_bins = 30,
show_progress = TRUE,
fcst_model = NULL,
...
)
# S3 method for harp_ens_point_df
bin_fcst_obs(
.fcst,
parameter,
groupings = "lead_time",
num_bins = 30,
show_progress = TRUE,
fcst_model = NULL,
...
)
Arguments
- .fcst
A
harp_df
data frame or aharp_list
.- parameter
The column containing the parameter. Can be unquoted, a quoted string, or an embraced variable name (i.e var).
- groupings
The groupings for which to compute the binned densities. Must be a vector of strings, or a list of vectors of strings.
- num_bins
The number of bins into which to partition the observations.
- show_progress
Logical. Whether to show a progress bar.
- ...
Arguments for methods.
- fcst_model
The name of the forecast model. If
.fcst
does not contain afcst_model
, a new column is created and populated with this value. If afcst_model
column exists, the value in the column is replaced with this value.