Scale2: Scale a data frame or matrix with custom scaling and...

Description Usage Arguments Value Examples

Description

an improvement of the base R scale function. Unlike R's standard scale function, this allows for factor columns or character columns to be present in the data, and will simply leave those untouched without throwing an error. This function takes a center function and scale function, allowing the user to customize the type of scaling. However, each must be a univariate function. For example, 'colMeans' will not work, but 'mean' will.

Usage

1
Scale2(data, center = mean, scale = sd)

Arguments

data

a data frame or vector

center

a function for estimating the center of each column. defaults to mean.

scale

a function for estimating the scale of each column. defaults to sd.

Value

A data frame

Examples

1

abnormally-distributed/cvreg documentation built on May 3, 2020, 3:45 p.m.