Description
When doing time series analysis and summarization, I like to have the name of the time variable include the interval, e.g. "sales_date_month" instead of "sales".
It might be useful to add functionality to automatically rename the .date_var in summarise_by_time like in e.g. pivot_wider(names_prefix = "") wherein a rename is passed the .by argument from summarise_by_time, also with an option to not rename.
As an example, the outcome would be the same as:
library(tidyverse)
library(timetk)
FANG %>%
group_by(symbol) %>%
summarise_by_time(
.date_var = date,
.by = "quarter",
volume = sum(volume)
) %>%
rename(quarter = date)
Thanks for considering and for the super-useful R package!
with the option to glue the .by to the .date_var, analogous to:
FANG %>%
group_by(symbol) %>%
summarise_by_time(
.date_var = date,
.by = "quarter",
volume = sum(volume)
) %>%
rename(quarter_date = date)
Activity