Feature branch feature1 is cut from development:
---o---o---o <-- development
\
A---B---C <-- feature1| ```{r diamonds_{{color}}_{{cut}}_plot} | |
| diamonds %>% | |
| filter( | |
| color == "{{color}}", | |
| cut == "{{cut}}" | |
| ) %>% | |
| ggplot(aes(carat, price, colour = clarity)) + | |
| geom_point(show.legend = FALSE) + | |
| labs( | |
| title = 'Price by carat for diamonds with color {{color}} and cut {{cut}}' |
| shift <- function(x, ..., shifts = 1, suffix = "lag") { | |
| vars <- unname(tidyselect::vars_select(names(x), !!!rlang::quos(...))) | |
| combinations <- expand.grid(var = vars, shift = shifts, stringsAsFactors = FALSE) | |
| shift_cols <- purrr::pmap_dfc(combinations, function(var, shift) { | |
| new_var <- glue::glue("lag_{var}_{shift}") | |
| tibble::tibble(!!new_var := dplyr::lag(x[[var]], shift)) | |
| }) | |
| dplyr::bind_cols(x, shift_cols) | |
| } |