rescale: Rescale Data

View source: R/rescale.R

rescaleR Documentation

Rescale Data

Description

Centers and scales columns in a data frame based on the columns in a second data frame. A column is centered by subtracting the mean and scaled by dividing by the standard deviation. Columns in scale are automatically added to center so they are standardised.

Usage

rescale(data, data2 = data, center = character(0), scale = character(0))

Arguments

data

The data frame to center and scale.

data2

A data frame to use for the centering and scaling.

center

A character vector of the columns to center.

scale

A character vector of the columns to scale (after centering).

Value

The data frame with rescaled columns.

See Also

scale, rescale_f and rescale_c

Examples

rescale(datasets::mtcars, scale = "mpg")

poissonconsulting/rescale documentation built on June 10, 2022, 5:22 p.m.