Regen.coin {COINr}R Documentation

Regenerate a coin

Description

Regenerates the .$Data entries in a coin by rerunning the construction functions according to the specifications in .$Log. This effectively regenerates the results. Different variations of coins can be quickly achieved by editing the saved arguments in .$Log and regenerating.

Usage

## S3 method for class 'coin'
Regen(x, from = NULL, quietly = TRUE, ...)

Arguments

x

A coin class object

from

Optional: a construction function name. If specified, regeneration begins from this function, rather than re-running all functions.

quietly

If TRUE (default), messages are suppressed during building.

...

arguments passed to or from other methods.

Details

The from argument allows partial regeneration, starting from a specified function. This can be helpful to speed up regeneration in some cases. However, keep in mind that if you change a .$Log argument from a function that is run before the point that you choose to start running from, it will not affect the results.

Note that while sets of weights will be passed to the regenerated COIN, anything in .$Analysis will be removed and will have to be recalculated.

See also vignette("adjustments") for more info on regeneration.

Value

Updated coin object with regenerated results (data sets).

Examples

# build full example coin
coin <- build_example_coin(quietly = TRUE)

# copy coin
coin2 <- coin

# change to prank function (percentile ranks)
# we don't need to specify any additional parameters (f_n_para) here
coin2$Log$Normalise$global_specs <- list(f_n = "n_prank")

# regenerate
coin2 <- Regen(coin2)

# compare index, sort by absolute rank difference
compare_coins(coin, coin2, dset = "Aggregated", iCode = "Index",
              sort_by = "Abs.diff", decreasing = TRUE)


[Package COINr version 1.1.7 Index]