scale_df {doBy} | R Documentation |
Scale numeric variables in a data frame
Description
Applies base::scale()
to numeric, integer, or
logical columns in a data frame. Non-numeric columns are left
unchanged.
Usage
scale_df(x, center = TRUE, scale = TRUE)
Arguments
x |
A data frame or matrix. |
center |
Logical; if TRUE, center the variables. |
scale |
Logical; if TRUE, scale the variables. |
Details
If x
is not a data frame, base::scale()
is applied directly.
Value
An object of the same class as x
.
Examples
scale_df(iris)
[Package doBy version 4.7.0 Index]