Skip to content

Instantly share code, notes, and snippets.

View DavisVaughan's full-sized avatar

Davis Vaughan DavisVaughan

View GitHub Profile
@DavisVaughan
DavisVaughan / hop.R
Created May 2, 2024 13:47
hop-with-window-param
blah
@DavisVaughan
DavisVaughan / zone-transitions.R
Created March 24, 2023 14:59
zone-transitions
library(clock)
library(purrr)
library(vctrs)
library(tibble)
generate_transitions <- function(zone,
from = date_build(1900, 1, 1),
to = date_build(2030, 1, 1)) {
days <- date_seq(
from = from,
@DavisVaughan
DavisVaughan / spooky.txt
Created October 31, 2022 15:57
spooky.txt
dummy
dummy
@DavisVaughan
DavisVaughan / baby.txt
Created October 31, 2022 15:44
baby.txt
dummy
dummy
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)
> install.packages("lubridate")
Warning in install.packages :
package ‘lubridate’ is in use and will not be installed
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 %>%