change_ind {COINr} | R Documentation |
Add and remove indicators
Description
A shortcut function to add and remove indicators. This will make the relevant changes
and recalculate the index if asked. Adding and removing is done relative to the current set of
indicators used in calculating the index results. Any indicators that are added must of course be
present in the original iData
and iMeta
that were input to new_coin()
.
Usage
change_ind(coin, add = NULL, drop = NULL, regen = FALSE)
Arguments
coin |
coin object |
add |
A character vector of indicator codes to add (must be present in the original input data) |
drop |
A character vector of indicator codes to remove (must be present in the original input data) |
regen |
Logical (default): if |
Details
See also vignette("adjustments")
.
This function replaces the now-defunct indChange()
from COINr < v1.0.
Value
An updated coin, with regenerated results if regen = TRUE
.
Examples
# build full example coin
coin <- build_example_coin(quietly = TRUE)
# exclude two indicators and regenerate
# remove two indicators and regenerate the coin
coin_remove <- change_ind(coin, drop = c("LPI", "Forest"), regen = TRUE)
coin_remove