Learn R Programming

simaerep (version 0.7.0)

plot.simaerep: plot AE under-reporting simulation results

Description

generic plot function for simaerep objects

Usage

# S3 method for simaerep
plot(
  x,
  ...,
  study = NULL,
  what = "ur",
  n_sites = 16,
  df_visit = NULL,
  env = parent.frame(),
  plot_event = "ae"
)

Value

ggplot object

Arguments

x

simaerep object

...

additional parameters passed to plot_study() or plot_visit_med75()

study

character specifying study to be plotted, Default: NULL

what

one of c("ur", "med75"), specifying whether to plot site AE under-reporting or visit_med75 values, Default: 'ur'

n_sites

number of sites to plot, Default: 16

df_visit

optional, pass original visit data if it cannot be retrieved from parent environment, Default: NULL

env

optional, pass environment from which to retrieve original visit data, Default: parent.frame()

plot_event

vector containing the events that should be plotted, default = "ae"

Details

see plot_study() and plot_visit_med75()

Examples

Run this code
# \donttest{
df_visit <- sim_test_data_study(
  n_pat = 100,
  n_sites = 5,
  frac_site_with_ur = 0.4,
  ur_rate = 0.6
)

df_visit$study_id <- "A"

aerep <- simaerep(df_visit)

plot(aerep, what = "ur", study = "A")
plot(aerep, what = "med75", study = "A")
# }

Run the code above in your browser using DataLab