This file contains hidden or 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
| dummy |
This file contains hidden or 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
| dummy |
This file contains hidden or 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
| foo |
This file contains hidden or 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
| f1 <- function(...) { | |
| data <- list(a = 100) | |
| # Optionally, for performance if calling `eval_tidy()` a lot: | |
| # data <- as_data_mask(data) | |
| dots <- rlang::enquos(...) | |
| n_dots <- length(dots) | |
| out <- vector("list", length = n_dots) | |
This file contains hidden or 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
| > install.packages("lubridate") | |
| Warning in install.packages : | |
| package ‘lubridate’ is in use and will not be installed |
This file contains hidden or 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
| library(tidyr) | |
| library(dplyr) | |
| df <- tibble( | |
| g1 = c("x", "x", "y", "y", "y"), | |
| g2 = factor(c("a", "a", "a", "b", "a"), levels = c("a", "b", "c")) | |
| ) | |
| df | |
| df %>% |
This file contains hidden or 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
| library(tidyverse) | |
| library(almanac) | |
| library(clock) | |
| # Define a recurrence rule for "all weekdays" | |
| on_weekdays <- daily(since = "2012-01-01", until = "2022-12-31") %>% | |
| recur_on_weekdays() | |
| # Generate all of the "events" in the recurrence rule (i.e. all weekdays) | |
| # then manipulate the results to get the day number per month |
This file contains hidden or 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
| #dummy |
This file contains hidden or 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
| foo |
This file contains hidden or 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
| df <- tibble( | |
| g = c(1, 1, 1, 1, 2, 2, 2, 2), | |
| x = 1:8, | |
| y = 8:1 | |
| ) | |
| # Group to show that this is applied per groups nicely | |
| df <- group_by(df, g) | |
| x <- df$x |