#' Create the TidyTuesday directory
#' @importFrom fs dir_create
#' @importFrom here here
#' @importFrom glue glue
#' @importFrom lubridate year
#' @importFrom lubridate wday
#' @export
create_tt_folder <- function() {
# Logic check if Tuesday calc fails
if (lubridate::wday(next_tuesday(), label = TRUE) != "Tue") {
stop("Today ain't Tuesday bub!")
}
fs::dir_create(
here::here(
lubridate::year(lubridate::today()),
tidytuesdaymeta::next_tuesday()
)
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.