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.
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 ofc("days", "weeks", "months", "years")
.- aes_color
either
variable
("{dataset} - {column}") orlabel
(the column label)- plotly
whether to use
{plotly}
to get an interactive plot- .lookup
deprecated
Examples
#db = read_trialmaster("filename.zip", pw="xx")
db = edc_example()
#> Warning: Option "edc_lookup" has been overwritten.
load_database(db)
p = edc_swimmerplot(id_lim=c(5,45))
#> Warning: Could not find 8/8 datasets from the lookup, did you forget to call
#> `load_database()` on your import?
#> ℹ "long_pure", "data1", "long_mixed", "data2", "data3", "enrol", "short", and
#> "ae"
#> Error: None of the datasets contains an identifier column
#> ℹ `id`="subjid"
p2 = edc_swimmerplot(origin="enrol$enrol_date", time_unit="weeks",
exclude=c("DATA1$DATE2", "data3$.*"))
#> Warning: Could not find 8/8 datasets from the lookup, did you forget to call
#> `load_database()` on your import?
#> ℹ "long_pure", "data1", "long_mixed", "data2", "data3", "enrol", "short", 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_database()` on your import?
#> ℹ "long_pure", "data1", "long_mixed", "data2", "data3", "enrol", "short", 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")
} # }