Created
December 11, 2017 14:14
-
-
Save czeildi/3c54b3cae8cf4bb74daa070127197096 to your computer and use it in GitHub Desktop.
weekday labeller for ggplot2 axis labels
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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