rescale_cols: A simple (but very useful) function to rescale variables...

Description Usage Arguments Examples

Description

This function allows for a set of variables to be rescaled from any original min and max to any target min and max.

Usage

1
rescale_cols(data, variables, old.min, old.max, new.min, new.max)

Arguments

data

The input dataset

variables

A character vector of variables to be operated on

old.min

the minima of the current variables

old.max

the maxima of the current variables

new.min

the minima of the new variables

new.max

the maxima of the new variables

Examples

1
2
# rescale the carb column of mtcars from 1-8 to 1-100.
rescale_cols(mtcars, 'carb', old.min = 1, old.max = 8, new.min = 1, new.max = 100)

seanchrismurphy/emacalc documentation built on May 12, 2019, 2:03 p.m.