Description Usage Arguments Details Value Author(s)
View source: R/aggregateAndFillDateGroupGaps.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 | aggregateAndFillDateGroupGaps(msCalFrame, yearSubGroup, gappedFrame, colsToAgg,
startDate, functionCol, funToPerform, sparseHandling)
|
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' |
gappedFrame |
is a data.frame containing a Year and [yearSubGroup], as well as additional columns that are sparesely populated |
colsToAgg |
is a vector of character strings which specifies which variables should be used as arguments to aggregate the numerical column (functionCol) |
startDate |
is a character string, such as what is returned from the |
functionCol |
is acharacter string indicating which variable of the gappedFrame should be aggregated, the variable should contain numeric values |
funToPerform |
is a character string specifying the function to pass to aggregate (options = 'sum','mean', etc.) |
sparseHandling |
is a numeric parameter than indicates how to handle sparse entries (i.e. DateGroups without entries) with options NA, 0, or 1 |
The function takes in msCalFrame, yearSubGroup, gappedFrame, colsToAgg, startDate, functionCol, funToPerform, and sparseHandling parameter and returns a data.frame that contains all DateGroups (per the msCalFrame), colsToAgg (e.g. 'Version', 'Key', 'RecordedValue'), functionCol (e.g. 'Record' with sparseHandling filled into sparse dates for each unique combo of colsToAgg).
a data frame that contains a DateGroup, colsToAgg, and a total of the functionCol for each DateGroup with the sparseHandling value for DateGroups not originally in the gappedFrame
Aimie Faucett
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.