Plot index scores from five dimensional cognitive testing. Includes option to facet.
index_plot(
ds,
id = "id",
sub_plot = "_is",
scores = c("_is", "_lo", "_up", "_per"),
dom_names = c("immediate", "visuospatial", "verbal", "attention", "delayed", "total"),
facet.by = NULL
)
ggplot element
complete data frame
colname of id column. Base for colouring
main outcome scores variable to plot
variables to subset for plotting. Has to follow standard naming (is to be changed)
domain names for axis naming
variable to base facet_grid on
index_plot(stRoke::score[score$event=="A",])
Run the code above in your browser using DataLab