Skip to contents

plot_gof() plots summary boxplots of one or a list of GOF tables as ggplots.

Usage

plot_gof(gof_tbls, gofs = NULL, colors = NULL, n_col = 3)

Arguments

gof_tbls

A data.frame containing goodness of fit values, or a list of such tables.

gofs

(optional) A character vector indicating selected GOFs to plot. Default is NULL and all GOFs in the provided gof_tbls are plotted

colors

(optional) A character vector to define the fill colors of the boxes. Must be the same length as the number of tables to plot. Default is NULL and a default color pallette is used.

n_col

(optional) Number of columns of plot panels to plot. Default is n_col = 3

Value

A ggplot object with boxplots of GOF values.

See also

Examples

if (FALSE) {
library(SWATrunR)

# Generate dummy gof table
n <- 50
gof_cal <- data.frame(run   = id_to_run(1:n, n),
                      nse   = runif(n, 0.4, 0.7),
                      pbias = runif(n, -25, 0),
                      kge   = runif(n, 0.5, 0.8))

# Plot single glof table
plot_gof(gof_cal)

# Plot list of gof tables
gof_val <- data.frame(run   = id_to_run(1:n, n),
                      nse   = runif(n, 0.2, 0.55),
                      pbias = runif(n, -20, 10),
                      kge   = runif(n, 0.3, 0.55))

gof_tbls <- list(calibration = gof_cal, validation = gof_val)

plot_gof(gof_tbls)
}