move_values_to_means: Move values towards means

Description Usage Arguments Value Examples

Description

Move a vector of values in the direction of a vector of means.

Usage

1
move_values_to_means(values, means, amount_change)

Arguments

values

The vector with values to move to the mean.

means

The vector with means to which values should be moved.

amount_change

Vector with the amounts by which each value should be moved to its corresponding mean.

Value

values plus or minus amount_change, or values if values is equal to means.

Examples

1
2
3
4
5
6
ShadowCAT:::move_values_to_means(values = 1, means = 2, amount_change = .1)
ShadowCAT:::move_values_to_means(values = 3, means = 2, amount_change = .1)
ShadowCAT:::move_values_to_means(values = 2, means = 2, amount_change = .1)
ShadowCAT:::move_values_to_means(values = c(1, 2, 3), 
                                 means = c(1, 5, -1), 
                                 amount_change = rep(.1, 3))

Karel-Kroeze/ShadowCAT documentation built on May 7, 2019, 12:28 p.m.