Description Usage Arguments Details Value Author(s)
View source: R/findStartDate.R
The function sequences DateGroups from last date to today, incrementing by -1, and keeps the number of DateGroup units as specified by the user.
1 2 | findStartDate(msCalFrame, yearSubGroup, timeUnitsToKeep, rollPeriods = 0,
keepPeriods)
|
msCalFrame |
is a data frame (non-sparse) of all dates and DateGroups, an output of |
yearSubGroup |
is a sub-group of a year, i.e. 'Week', 'Month', or 'Quarter' |
timeUnitsToKeep |
is a numeric value indicating how many of DateGroup entries to keep (incremented by 1 backwards from today's DateGroup) |
rollPeriods |
is a numeric value indicating how many additional periods should be included in case the user wants to find a rolling sum, the default is 0. |
keepPeriods |
is a numeric value indicating how many periods to keep such that the limit at calculation is the same as what it would have been when the period was current. |
This function takes in msCalFrame, yearSubGroup, timeUnitsToKeep, and rollPeriods. The unique msCalFrame DateGroups are found and then sequenced in descending order. The number of entries kept is specified by timeUnitsToKeep + rollPeriods. The function returns the startDate (character string) as determined by the timeUnitsToKeep + rollPeriods prior to the most current DateGroup.
a character string DateGroup at timeUnitsToKeep + rollPeriods prior (e.g. 2016-01 if today's DateGroup is 2016-10 and timeUnitsToKeep = 9 and rollPeriods = 0)
Aimie Faucett
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.