get_transform_dim_date: Creates a Date Dimension table i.e. 'dim_date'. This is...

Description Usage Arguments Value Examples

View source: R/dim-date-transform.R

Description

Creates a Date Dimension table i.e. dim_date. This is useful to get date attributes for a sequence of dates as specified by the user. This table can be used for joining attributes by date for existing tables and also for subsetting tables by date where this is faster by joining rather than by filtering.

Usage

1
2
3
4
get_transform_dim_date(
  all_dates_start = as.Date("1981-01-01"),
  all_dates_end = Sys.Date()
)

Arguments

all_dates_start

(date) : The starting date value for our date dimension table. The default value is as.Date("1981-01-01").

all_dates_end

(date) : The ending date value for our date dimension table. The default value is as.Date("2025-01-01").

Value

(tibble) : The dim_date tibble to be uploaded to postGIS for our purposes

Examples

1
2
3
4
5
6
7
8
## Not run: 
# Input start and end dates
ALL_DATES_START <- as.Date("1981-01-01")
ALL_DATES_END <- as.Date("2025-01-01")
out_dim_date <- get_transform_dim_date(all_dates_start = ALL_DATES_START,
                                       all_dates_end = ALL_DATES_END)

## End(Not run)

shamindras/backburner documentation built on Feb. 28, 2021, 12:20 a.m.