expand_date: expand_date

Description Usage Arguments Value Examples

Description

Expand a date range

Usage

1
expand_date(.data, date_variable, .aggregate_date = "year", .fill = 0)

Arguments

.data

tbl_df with a R-readable date column

date_variable

R-readable date column

.aggregate_date

level that the temporal unit expansion entries should be aggregated to

.fill

specify what to fill numeric values with; default is 0

Value

tbl_df with the date gaps filled

Examples

1
2
3
4
5
6
7
require(dplyr)
connect_phx_db() %>% 
filter(code=="041") %>% 
select(date,code) %>% 
head(30) %>% 
collect() %>% 
expand_date(date,.aggregate_date = "day",.fill=0) 

edunford/phx documentation built on June 6, 2019, 12:22 p.m.