Skip to content

Instantly share code, notes, and snippets.

@czeildi
Created December 11, 2017 14:14
Show Gist options
  • Save czeildi/3c54b3cae8cf4bb74daa070127197096 to your computer and use it in GitHub Desktop.
Save czeildi/3c54b3cae8cf4bb74daa070127197096 to your computer and use it in GitHub Desktop.
weekday labeller for ggplot2 axis labels
convertNumToWeekdayName <- function(weekday_num) {
c(
"Sunday",
"Monday", "Tuesday", "Wednesday", "Thursday",
"Friday", "Saturday"
) %>%
.[weekday_num + 1]
}
weekdayLabeller <- function() {
function(label) {
convertNumToWeekdayName(as.numeric(label))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment