agg_to_freq_wide {dateutils} | R Documentation |
Aggregate data.table and return wide format
Description
Aggregate a data.table to a specified frequency and return wide format data
Usage
agg_to_freq_wide(
dt,
date_name = "ref_date",
frq = c("month", "week", "quarter", "year"),
id_name = "series_name",
value_name = "value",
dt_is_wide = FALSE
)
Arguments
dt |
data.table in long format |
date_name |
name of date column |
frq |
frequency for aggregation, one of '"month"', '"week"', '"quarter"', or '"year"' |
id_name |
name of id column |
value_name |
name of value column |
dt_is_wide |
T/F, is input data 'dt' in wide format |
Value
Aggregated data at specificed frequency in wide format
Examples
out <- agg_to_freq_wide(fred,frq="quarter")
[Package dateutils version 0.1.5 Index]