Skip to contents

Plot observed and modeled dissolved oxygen

Usage

fit_plot(res, bygroup = FALSE, scatter = FALSE, showfit = TRUE)

Arguments

res

output data frame from ebase

bygroup

logical indicating if the plot is faceted by group

scatter

logical indicating if a scatter plot of modeled versus estimated dissolved oxygen is returned

showfit

logical indicating if a linear fit is shown in the plot, applies only if scatter = TRUE

Value

A ggplot object

Details

Dissolved oxygen (mmol/m3) is plotted as observed from the input data (points) and modeled (lines) based on inputs to ebase if scatter = FALSE. A scatter plot of modeled versus estimated dissolved oxygen is returned if scatter = TRUE, including a linear fit if showfit = TRUE. The plot is faceted by group based on the ndays argument to ebase if bygroup = TRUE. The r-squared value of the fit between modeled and observed dissolved oxygen is also shown in the facet label for the group if bygroup = TRUE.

Examples

# plot observed and modeled DO
fit_plot(exres)


# plot observed and modeled DO by group
fit_plot(exres, bygroup = TRUE)


# as scatter plot
fit_plot(exres, scatter = TRUE)


# as scatter plot by group
fit_plot(exres, scatter = TRUE, bygroup = TRUE)