centreAndScale | R Documentation |
centreAndScale
allows column-wise mean centring and
standard-deviation scaling for a dataframe or matrix. The extra
features of this function are the following:
centreAndScale(grid, centre, scale, message = TRUE)
grid |
dataframe or matrix. |
centre |
logical. If TRUE, then each column has its own mean subtracted |
scale |
logical. If TRUE, then each column is divided by its own standard deviation. If a column has zero standard deviation, then it is returned as is. |
message |
logical. If TRUE, then |
If a column has zero standard deviation, then scaling has no effect. A message is outputted to inform the user.
A dataframe may be provided with character columns. These are simply ignored for the purposes of centring and scaling.
A dataframe or a matrix may be provided. If the input was a matrix, then the output is also a matrix. If the input inherits from the dataframe class, then the output is a tibble.
A tibble or a matrix, depending on whether grid
inherited from the dataframe class or was a matrix.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.