Skip to contents

Join all tables on id with only date columns to build a ggplot (or a plotly if plotly=TRUE) showing all dates for each patients. This allows outliers to be easily identified.

Usage

edc_swimmerplot(
  ...,
  group = NULL,
  origin = NULL,
  id_lim = NULL,
  exclude = NULL,
  id = get_subjid_cols(),
  time_unit = c("days", "weeks", "months", "years"),
  aes_color = c("variable", "label"),
  plotly = getOption("edc_plotly", FALSE),
  .lookup = "deprecated"
)

Arguments

...

not used

group

a grouping variable, given as "dataset$column"

origin

a variable to consider as time 0, given as "dataset$column"

id_lim

a numeric vector of length 2 providing the minimum and maximum id to subset on.

exclude

a character vector of variables to exclude, in the form dataset$column. Can be a regex, but $ symbols don't count. Case-insensitive.

id

the patient identifier. Will be coerced as numeric if possible.

time_unit

if origin!=NULL, the unit to measure time. One of c("days", "weeks", "months", "years").

aes_color

either variable ("{dataset} - {column}") or label (the column label)

plotly

whether to use {plotly} to get an interactive plot

.lookup

deprecated

Value

either a plotly or a ggplot

Examples

#tm = read_trialmaster("filename.zip", pw="xx")
tm = edc_example()
#> Warning: Option "edc_lookup" has been overwritten.
load_list(tm)
p = edc_swimmerplot(id_lim=c(5,45))
#> Warning: Could not find 8/8 datasets from the lookup, did you forget to call
#> `load_list()` on your import?
#>  "enrol", "db2", "db3", "short", "db1", "long_mixed", "long_pure", and "ae"
#> Error: None of the datasets contains an identifier column
#>  `id`="subjid"
p2 = edc_swimmerplot(origin="enrol$date_naissance", time_unit="weeks", 
                     exclude=c("DB1$DATE2", "db3$.*"))
#> Warning: Could not find 8/8 datasets from the lookup, did you forget to call
#> `load_list()` on your import?
#>  "enrol", "db2", "db3", "short", "db1", "long_mixed", "long_pure", and "ae"
#> Error: None of the datasets contains an identifier column
#>  `id`="subjid"
p3 = edc_swimmerplot(group="enrol$arm", aes_color="label")
#> Warning: Could not find 8/8 datasets from the lookup, did you forget to call
#> `load_list()` on your import?
#>  "enrol", "db2", "db3", "short", "db1", "long_mixed", "long_pure", and "ae"
#> Error: None of the datasets contains an identifier column
#>  `id`="subjid"
if (FALSE) { # \dontrun{
#save the plotly plot as HTML to share it
save_plotly(p, "edc_swimmerplot.html")
} # }