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 June 4, 2017, 1:02 a.m.