Skip to content

Instantly share code, notes, and snippets.

View bryangoodrich's full-sized avatar

Bryan Goodrich bryangoodrich

View GitHub Profile
@mrdwab
mrdwab / dailyCalendar.R
Last active December 28, 2015 14:29
Defines a "WeekDays" constant and a "dailyCalendar" function
WeekDays <- function(startOn = "Monday", abbreviate = FALSE) {
WD <- c("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday")
x <- match(startOn, WD)
WD <- WD[c(x:7, setdiff(1:7, x:7))]
if (isTRUE(abbreviate)) {
substring(WD, 0, 3)
} else WD
}