scale_df: Scaling numerical values

View source: R/by_scaleBy.R

scale_dfR Documentation

Scaling numerical values

Description

Similar to 'base::scale' but applies to scales / centers only numeric values in data.

Usage

scale_df(x, center = TRUE, scale = TRUE)

scale2(x, center = TRUE, scale = TRUE)

Arguments

x

dataframe or matrix

center

Logical, should data be centered.

scale

Logical, should data be scaled.

Details

  • If x is not a dataframe, then base::scale is invoked on x.

  • Suppose x is a dataframe. Then base::scale is invoked on all columns that are numeric, integer or logical.

Value

An object of same class as x

Examples


scale2(iris)

hojsgaard/doBy documentation built on May 4, 2024, 5:20 a.m.