plot_sd: Creates plot of model results (uncertainties optional)

View source: R/plotting.r

plot_sdR Documentation

Creates plot of model results (uncertainties optional)

Description

All parameter combinations and exposure patterns are simulated and the mean of predictions is derived for a single study. The uncertainty is passed to the function due to computation time. Results are displayed by plotting the time series including the uncertainty interval. Observation data can be optionally displayed. Data should be provided in long format. Function plots the time (column 1) and the predictions (column 2, can be changed by the user plot_col)

Usage

plot_sd(
  model_base,
  treatments,
  rs_mean,
  rs_range = NULL,
  obs_mean = NULL,
  obs_full = NULL,
  x_breaks = NULL,
  y_lim = NULL,
  grid_labels = NULL,
  grid_ncol = 2,
  plot_col = 2,
  y_title = NULL,
  ...
)

Arguments

model_base

effect scenario object with mean parameters

treatments

treatments exposure levels as data frame

rs_mean

data.frame, model results best fit params

rs_range

data.frame, uncertainties as data frame

obs_mean

data.frame, observation data with means per treatment level

obs_full

data.frame, full set including results for replicates

x_breaks

optional vector of breaks of x-axis

y_lim

optional vector containing limits of y-axis

grid_labels

optional labels of grid headers

grid_ncol

optional number of grid columns

plot_col

output column which should be plotted

y_title

optional title of y-axis

...

any additional parameters

Value

a ggplot2 plot object

Examples

set.seed(124)
exposure <- data.frame(
  time = 0:21,
  conc = rnorm(n = 22, mean = 0.1, sd = 0.06),
  trial = "T1"
)
forcings <- list(temp = 12, rad = 15000)
param <- list(EC50 = 0.3, b = 4.16, P_up = 0.0054)
inits <- list(BM = 0.0012, E = 1, M_int = 0)

scenario <- Lemna_Schmitt() %>%
  set_forcings(forcings) %>%
  set_param(param) %>%
  set_init(inits)

sim_result <- simulate_batch(
  model_base = scenario,
  treatments = exposure,
  param_sample = NULL
)

plot_sd(
  model_base = scenario,
  treatments = exposure,
  rs_mean = sim_result
)

cvasi documentation built on Sept. 23, 2024, 9:08 a.m.