Safety Results Over Time plot
safety_results_over_time(data, settings)
data | labs data structured as one record per person per visit per measurement. See details for column requirements. |
---|---|
settings | named list of settings with the parameters specified below. |
returns a chart object
The settings object provides details the columns in the data set.
"value_col"Value column
"measure_col"Measure column
"measure_values"Measure values
"visit_col"Study Visit
"visitn_col"Study Number
"group_col"Grouping column
"violins"Show Violin plots?
"boxplots"Show Box Plots?
"axis"set to "log" to use a log transformed axis, linear otherwise
"drop_visit_string"Drop visits that contain this string. e.g. "unscheduled"
#> #>#>#> #>#>#> #>lb <- safetyData::sdtm_lb sub_ids <- unique(lb$USUBJID)[1:100] lb<-lb %>% filter(USUBJID %in% sub_ids) settings <- list( value_col = "LBORRES", measure_col = "LBTEST", measure_values = c("Chloride"), visit_col = "VISIT", visitn_col = "VISITNUM", axis = "log" ) safety_results_over_time(lb, settings)#> Warning: `fun.y` is deprecated. Use `fun` instead.# remove unscheduled visits, add violin plot and 2nd panel settings$drop_visit_string <- "unscheduled" settings$violins <- TRUE settings$measure_values <- c("Albumin") safety_results_over_time(lb, settings)#> Warning: `fun.y` is deprecated. Use `fun` instead.#> Warning: Groups with fewer than two data points have been dropped.# add grouping by treatment dm_sub <- safetyData::sdtm_dm %>% select(USUBJID, ARM) dm_lb <- dm_sub %>% left_join(lb)#>settings$group_col <- "ARM" safety_results_over_time(dm_lb, settings)#> Warning: `fun.y` is deprecated. Use `fun` instead.#> Warning: Groups with fewer than two data points have been dropped.