zt: Extended function for z-transformation, filling non-finite values and changes column names at will
Description
An extended function of the standard z-score standardization of a vector in R (i.e. function 'scale'). Supports filling in non-finite values as well as re-naming variables to distinguish them from non-standardized variables.
Usage
zt(x, fillfinite = 0, addz = T, saveattr = T)
Value
z-score standardized values (zero mean and unit variation), with non-finite values imputed by zero by default.
Arguments
x
A data matrix for which the columns are to be standardized
fillfinite
The value to fill non-finite values with, by default zero.
addz
Boolean indicating whether letter 'z' should be appended to the variable names to indicate the standardization
saveattr
Boolean for if an 'attr' should be attached to the standardized vector, similar to how the R default function 'scale' conserves the centering and scaling values