# NOT RUN {
x <- 1:5
y <- 6:10
z <- 11:15
lst <- list(x = x, y = y, z = z)
df <- as.data.frame(lst)
stretch2(x, y, sum, .size = 2)
stretch2(lst, lst, ~ ., .size = 2)
stretch2(df, df, ~ ., .size = 2)
pstretch(lst, sum, .size = 1)
pstretch(list(lst, lst), ~ ., .size = 2)
###
# row-wise stretching over data frame
###
x <- as.Date("2017-01-01") + 0:364
df <- data.frame(x = x, y = seq_along(x))
tibble(
data = pstretch(df, function(...) as_tibble(list(...)), .init = 10)
)
# }
Run the code above in your browser using DataLab