analyse_modobs2: Analyse modelled values versus observed data.

View source: R/analyse_modobs2.R

analyse_modobs2R Documentation

Analyse modelled values versus observed data.

Description

Calculates a set of performance statistics and optionally creates plots of modelled versus observed values.

Usage

analyse_modobs2(
  df,
  mod,
  obs,
  type = "points",
  filnam = NA,
  relative = FALSE,
  xlim = NULL,
  ylim = NULL,
  use_factor = NULL,
  shortsubtitle = FALSE,
  rsquared = TRUE,
  plot_subtitle = TRUE,
  plot_linmod = TRUE,
  plot_legend = TRUE,
  label = FALSE,
  id = NULL,
  nlabels = 1,
  ...
)

Arguments

df

A data frame containing columns with names corresponding to arguments mod and obs

mod

A character string specifying the variable name (column) of the modelled (simulated) values in data frame df.

obs

A character string specifying the variable name (column) of the observed values in data frame df.

type

If "points", uses geom_points(), if "hex" uses ggplot2::geom_hex(), if "heat" uses adjusted geom_points() with color indicating density, if "density" uses stat_density_2d() to draws polygos of equal density.

filnam

A character string specifying the name of the file containing the plot. Defaults to NA (no file is created).

relative

A logical specifying whether the relative RMSE and bias (after division by the mean) is to be showed in the subtitle labels.

shortsubtitle

A boolean specifying whether to display a reduced set of metrics in the subtitle.

rsquared

A boolean specifying whether to display R-squared and the RMSE (if TRUE) or the r (Pearson's correlation coefficient) and the p (p-value of test of significance of correlation, if TRUE). Defaluts to TRUE.

plot_subtitle

A boolean specifying whether to display any metrics. Defaults to TRUE.

plot_linmod

A boolean specifying whether to display the fitted linear regression as a red line. Defaults to TRUE.

plot_legend

A boolean specifying whether to display a legend for the colors. Defaults to TRUE if type is one of "heat", "hex", or "density".

label

A boolean specifying whether points should be labelled using ggrepel. Defaults to FALSE. Only available for type == "points". Use argument nlabels to specify how many points should be labelled, starting with points that have the largest residuals from the linear regression fit.

id

A character string specifying the column name that identifies the points. The column's values must be of type integer and is used to label points in case of label = TRUE.

nlabels

An integer specifying how many points to be labelled, starting with points that have the largest residuals from the linear regression fit. Only available for type == "points". Defaults to one.


stineb/rbeni documentation built on Feb. 24, 2023, 5:40 a.m.