latestPeriod: Most Recent Period Time Indexes In tis: Time Indexes and Time Indexed Series

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``` ```latestWeek(xTi = today()) latestMonth(xTi = today()) latestQuarter(xTi = today()) latestHalf(xTi = today()) latestYear(xTi = today()) latestQ4(xTi = today()) latestJanuary(xTi = today()) latestFebruary(xTi = today()) latestMarch(xTi = today()) latestApril(xTi = today()) latestMay(xTi = today()) latestJune(xTi = today()) latestJuly(xTi = today()) latestAugust(xTi = today()) latestSeptember(xTi = today()) latestOctober(xTi = today()) latestNovember(xTi = today()) latestDecember(xTi = today()) ```

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.

`ti`, `tif`, `currentWeek` `setDefaultFrequencies`