anhoej / qicharts2

R package: Quality improvement charts
38 stars 12 forks source link

Option to start on Sunday? #39

Closed rjake closed 1 year ago

rjake commented 1 year ago

I'm curious if we could have an option to start on Sundays when using x.period = "week". If something like this would work, I can create a PR

    if (!is.null(x.period)) {
        x <- as.POSIXct(
        cut(
          x, 
          breaks = x.period, 
          start.on.monday = getOption('qic.monday_start', default = TRUE))  # <----
        )
    }

https://github.com/anhoej/qicharts2/blob/14b9295364faa9bc076235a8bd18363b95a78f32/R/qic.R#LL257C14-L257C50

anhoej commented 1 year ago

Thank you for your suggestions. Go ahead. I am reluctant to introduce more arguments and options to qicharts2 - there are already too many. But if you can implement it as a global option the same way as other qic.* options I think I might work.