rescale_variable: Rescale a variable

Description Usage Arguments Value

View source: R/transform_variables.R

Description

rescale_variable rescales a variable from an old range of values (min_old to max_old) to a new range (min_new to max_new). Default behavior is to rescale a variable to a new range from 0 to 1 where the minimum observed value is recoded to 0 and the maximum observed value is recoded to 1.

Usage

1
rescale_variable(x, min_old, min_new = 0, max_old, max_new = 1)

Arguments

x

A numeric variable.

min_old

The old minimum value for the variable. Default is the variable's minimum value.

min_new

The new minimum value, defaults to 0.

max_old

The old maximum value for the variable. Default is the variable's maximum value.

max_new

The new maximum value, defaults to 1.

Value

The rescaled variable.


jogrue/jogRu documentation built on Sept. 26, 2018, 6:58 a.m.