extend.time: Extends a vector of dates to a given length

extend.timeR Documentation

Extends a vector of dates to a given length

Description

Pads a vector of dates to a specified length.

Usage

   ExtendTime(dates, number.of.periods, dt = NULL)

Arguments

dates

An ordered vector of class Date.

number.of.periods

The desired length of the output.

dt

A character string describing the frequency of the dates in dates. Possible values are "daily", "weekly", "monthly", "quarterly", "yearly", or "other". An attempt to deduce dt will be made if it is missing.

Value

If number.of.periods is longer than length(dates), then dates will be padded to the desired length. Extra dates are added at time intervals matching the average interval in dates. Thus they may not be

Author(s)

Steven L. Scott steve.the.bayesian@gmail.com

See Also

bsts.mixed.

Examples

  origin.month <- as.Date("2011-09-01")
  week.ending <- as.Date(c("2011-10-01",   ## 1
                           "2011-10-08",   ## 2
                           "2011-12-03",   ## 3
                           "2011-12-31"))  ## 4
  MatchWeekToMonth(week.ending, origin.month) == 1:4

bsts documentation built on May 29, 2024, 2:14 a.m.