Denominate.purse {COINr} | R Documentation |
Denominate a data set within a purse.
Description
This works in almost exactly the same way as Denominate.coin()
. The only point of care is that the
denoms
argument here cannot take time-indexed data, but only a single value for each unit. It is
therefore recommended to pass the time-dependent denominator data as part of iData
when calling
new_coin()
. In this way, denominators can vary with time. See vignette("denomination")
.
Usage
## S3 method for class 'purse'
Denominate(
x,
dset,
denoms = NULL,
denomby = NULL,
denoms_ID = NULL,
f_denom = NULL,
write_to = NULL,
...
)
Arguments
x |
A purse class object |
dset |
The name of the data set to apply the function to, which should be accessible in |
denoms |
An optional data frame of denominator data. Columns should be denominator data, with column names corresponding
to entries in |
denomby |
Optional data frame which specifies which denominators to use for each indicator, and any scaling factors
to apply. Should have columns |
denoms_ID |
An ID column for matching |
f_denom |
A function which takes two numeric vector arguments and is used to perform the denomination for each
column. By default, this is division, i.e. |
write_to |
If specified, writes the aggregated data to |
... |
arguments passed to or from other methods. |
Value
An updated purse
Examples
# build example purse
purse <- build_example_purse(up_to = "new_coin", quietly = TRUE)
# denominate using data/specs already included in coin
purse <- Denominate(purse, dset = "Raw")