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.

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

if (FALSE) { # 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) }