Description Usage Arguments Details Value Author(s)
View source: R/mergeCalSparseFrames.R
This function merges two data frames that are created using aggregateAndFillDataGroupGaps and creates a rate with roll capability and sparse entry handling.
1 2 | mergeCalSparseFrames(numFrame, denomFrame, mergeColsX, mergeColsY, numNumeric,
denomNumeric, sparseHandling, rollPeriods = 0)
|
numFrame |
a sparse data frame created using the |
denomFrame |
a sparse data frame created using the |
mergeColsX |
a vector of character strings specifying which columns to use in the |
mergeColsY |
a vector of character strings specifying which columns to use in the |
numNumeric |
a character string that identifies which column of the numFrame contains the numeric value to use as the numerator in the rate calculation |
denomNumeric |
a character string that identifies which column of the denomFrame contains the numeric value to use as the denominator in the rate calculation |
sparseHandling |
a numeric (either NA or 0) that tells the function how to handle sparse Rate values after the merge |
rollPeriods |
a numeric (default = 0) that indicates the number of periods to include in the rolling rate (0, default, is not rolled) |
This function takes a numFrame, denomFrame, mergeColsX, mergeColsY, numNumeric, denomNumeric, sparseHandling, rollPeriods, and lagPeriods. It returns a data.frame that contains a DateGroup, columns from numFrame (less the numNumeric column), and a Rate (either rolled or not with sparse entries handled as specified by the sparseHandling parameter). The rate is calculated by merging the numFrame and denomFrame by the mergeColsX and mergeColsY and then finding a rate for each unique combination of the merged columns.
a data frame that contains the orginal columns in numFrame as well as a Rate that is calculated using the numNumeric/denomNumeric and adjusted using sparseHandling for DateGroups that are sparse in the numFrame
Aimie Faucett
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.