Closed jazznbass closed 3 years ago
Oh I love that! I have a few ideas for plot.scdf() too. That would harmonize with the new approach.
I've been adding some more functions and extended the customisability. Here is a current example (a bit extensive to show the possibilities). Any suggestions are welcome :-)
scplot(exampleABAB) %>%
add_line("trendA", col = "red") %>%
add_line("maxA", col = "lightblue") %>%
add_marks(case = 1, positions = 14, col = "red", cex = 3, pch = 4) %>%
add_marks(case = 2, positions = c(17, 20), col = "red", cex = 3, pch = 4) %>%
add_marks(positions = outlier(exampleABAB), col = "brown", cex = 2) %>%
set_xaxis(increase = 4, label = "Weeks", cex = 0.7, col = "brown") %>%
set_yaxis(lim = c(0, 50), label = "Points", col = "sienna3", cex = 1, orientation = 0) %>%
add_title("Points by week", col = "salmon3", cex = 1.5, font = 3) %>%
set_phasenames("Baseline", "Intervention", "Fall-Back", "Intervention", cex = 1, col = "darkgreen") %>%
set_style("grid2") %>%
set_style("tiny") %>%
set_style(fill.bg = "grey96") %>%
add_text(case = 1, 5, 35, "Wow!!", col = "red") %>%
add_arrow(case = 1, 5, 30, 5, 22, col = "blue") %>%
set_casenames("MY", "FUNNY", "VALENTINE", col = "darkblue", cex = 0.6)
Meanwhile I started a new package scplot which is intended to be included into scan in a later Version. scplot generated ggplot2 output and thus is extremely versatile
Our plot function is becoming more and more bloated. I have redesigned a new approach which embraces a pipe structure and more straight forward functional programming (similar to ggplot). While keeping the previous plot function intact, i like to add it to v0.54 and gradually shift it to be the main approach. Here is an example of what it looks like:
beside the clear coding here are some more advantages:
Here is what the code for the above plot would look like with the current function:
@researchtool What do you think?