center_matrix {mfp2} | R Documentation |
Simple function to center data
Description
Simple function to center data
Usage
center_matrix(mat, centers = NULL)
Arguments
mat |
a transformed data matrix. |
centers |
a vector of centering values. Length must be equal to the
number of columns in |
Details
Centering is done by means for continuous variables (i.e. more than 2 distinct values), and the minimum for binary variables.
It is assumed all categorical variables in the data are represented by binary dummy variables.
Value
Transformed data matrix. Has an attribute scaled:center
that stores
values used for centering.
Examples
mat = matrix(1:100, nrow = 10)
center_matrix(mat)
[Package mfp2 version 1.0.0 Index]