Description Usage Arguments Details Value
The function takes wild card data to fill in original data for a particular variable.
1 | wildCardFill(originalData, wildCardData, variable, verbose = FALSE)
|
originalData |
The data to be filled in. This is typically a data.table with all year/location pairs. |
wildCardData |
The wild card data, see ratio or shares data extracted from the getShare and getRatio function. This should be a data.table with values to be inserted into originalData. |
variable |
The column name (of both originalData and wildCardData) of the variable to be filled. |
verbose |
Whether the output should be printed. |
Shares, ratio and balance element have area and year specific rates, but at the same time they have wild card values which are to be applied when the specific rates are not available.
This function fills in the gap with wild card values when year specific values are not available.
Note: this function is usually called several times to fill in one main data.table (originalData) with data from other data.tables (passed as wildCardData, and these tables have varying levels of specificity). The first time this function is called, it should be given the most specific data. Then, future calls should receive more and more general tables. The rationale is that the later tables will only overwrite values which are currently missing and no more.
No data is returned, but missing records in originalData are replaced by their corresponding records in wildCardData.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.