#' Matrix Standardization
#'
#' Standardize the columns of a matrix.
#'
#' @param M matrix with multiple rows.
#'
#' @return A new, standardized matrix.
#'
#' @export
#' @examples
#'
#' mstandardize(data3)
#'
mstandardize <- function (M){
standardize <- function(x){(x - mean(x)) / sd(x)}
stopifnot(nrow(M)>1)
apply (M, 2, standardize)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.