data(exampleAB_add, package = "scan")
scplot(exampleAB_add) |>
set_dataline("depression") |>
add_statline("mean") |>
add_legend()
scplot(exampleAB_add) |>
set_dataline(label = "Pychological Wellbeing") |>
set_dataline("depression", color = "darkblue", label = "Depression") |>
add_statline("mean", label = "Wellbeing mean") |>
add_statline("mean", variable = "depression", label = "Depression mean") |>
set_phasenames(color = NA) |>
set_panel(fill = c("lightblue", "grey80")) |>
add_legend(
position = "left",
section_labels = c("Variables", "Section"),
title = list(color = "brown", size = 10, face = 2),
text = list(color = "darkgreen", size = 10, face = 2),
background = list(color = "lightgrey")
)
Run the code above in your browser using DataLab