Most Recent Period Time Indexes

Description

Return a ti for the most recent period of the desired frequency.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18

Arguments

xTi

a ti object or something that the ti() function can turn into a ti object

Details

The latest{whatever} functions are the same as the corresponding current{whatever} functions, except that they return the most recent completed ti of the desired frequency. A period is considered to be completed on it last day. For example, if today is Thursday, then latestWedweek() returns the week that ended yesterday. Yesterday it would have returned the same week, but the day before that (Tuesday) it would have returned the "wwednesday" ti for the week that had ended six days before.

latestWeek returns the weekly ti for the most recently completed week as of xTi. If the xTi is itself a ti, the returned week is the most recently completed week as of the last day of xTi. (Note that the default weekly frequency is "wmonday" (Monday-ending weeks), so latestWeek always returns "wmonday" ti's.) See setDefaultFrequencies to change this.

All of the other latest{SomeFreq} functions work the same way, returning the ti's for the most recently completed SomeFreq as of the last day of xTi. The tif's (frequencies) for latestHalf and latestQ4 are "semiannual" and "quarterly", respectively.

latestJanuary returns the monthly ti for January of the most recently completed January-ending year that the last day of its argument falls into. latestFebruary returns the monthly ti for February of the most recently completed February-ending year that the last day of its argument falls into, and so on.

Value

All return return ti objects as described in the details.

See Also

ti, tif, currentWeek setDefaultFrequencies

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.