normalize {BBmisc} | R Documentation |
Normalizes numeric data to a given scale.
Description
Currently implemented for numeric vectors, numeric matrices and data.frame.
For matrixes one can operate on rows or columns
For data.frames, only the numeric columns are touched, all others are left unchanged.
Usage
normalize(x, method = "standardize", range = c(0, 1), margin = 1L)
Arguments
x |
[numeric | matrix | data.frame ]
Input vector.
|
method |
[character(1) ]
Normalizing method. Available are:
“center”: Subtract mean.
“scale”: Divide by standard deviation.
“standardize”: Center and scale.
“range”: Scale to a given range.
|
range |
[numeric(2) ]
Range for method “range”.
Default is c(0,1) .
|
margin |
[integer(1) ]
1 = rows, 2 = cols.
Same is in apply
Default is 1.
|
Value
[numeric
| matrix
| data.frame
].
See Also
scale
[Package
BBmisc version 1.7
Index]