standardize: Rescale variables, possibly excluding some columns

Description Usage Arguments Value See Also Examples

View source: R/standardize.R

Description

Simple extension to base::scale() to skip columns.

Usage

1
standardize(x, skip_vars = NULL, ...)

Arguments

x

Dataframe or matrix, assumed to have column names.

skip_vars

List of names of variables not to scale.

...

Extra arguments passed-through to base::scale

Value

Data-frame with appropriate variables scaled.

See Also

scale

Examples

1
2
3
4
5
6
7
8
library(ck37r)

data(Boston, package = "MASS")

# Don't scale our outcome variable.
data = standardize(Boston, skip_vars = "medv")

summary(data)

ck37r documentation built on Feb. 6, 2020, 5:09 p.m.

Related to standardize in ck37r...