The Scaling and centering Matrices

A simple analogue of R’s scale(A) function (with the default arguments) would be:

using LinearAlgebra, Statistics
scale(A) = mapslices(normalize!, A .- mean(A,dims=1), dims=1)
8 Likes