Skip to contents

Converts an older COIN class to the newer coin class. Note that there are some limitations to this. First, the function arguments used to create the COIN will not be passed to the coin, since the function arguments are different. This means that any data sets beyond "Raw" cannot be regenerated. The second limitation is that anything from the .$Analysis folder will not be passed on.

Usage

COIN_to_coin(COIN, recover_dsets = FALSE, out2 = "coin")

Arguments

COIN

A COIN class object, generated by COINr version <= 0.6.1, OR a list containing IndData, IndMeta and AggMeta entries.

recover_dsets

Logical: if TRUE, will recover data sets other than "Raw" which are found in the .$Data list.

out2

If "coin" (default) outputs a coin, else if "list", outputs a list with iData and iMeta entries. This may be useful if you want to make further edits before building the coin.

Value

A coin class object if out2 = "coin", else a list of data frames if out2 = "list".

Details

This function works by building the iData and iMeta arguments to new_coin(), using information from the COIN. It then uses these to build a coin if out2 = "coin" or else outputs both data frames in a list.

If recover_dsets = TRUE, any data sets found in COIN$Data (except "Raw") will also be put in coin$Data, in the correct format. These can be used to inspect the data but not to regenerate.

Note that if you want to exclude any indicators, you will have to set out2 = "list" and build the coin in a separate step with exclude specified. Any exclusions/inclusions from the COIN are not passed on automatically.

Examples

# see vignette("other_functions")