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 TRUE, automatically regenerates the results based on the new specs Otherwise, just updates the .$Log parameters. This latter might be useful if you want to Make other changes before re-running using the Regen() function.

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


[Package COINr version 1.1.7 Index]