| d_zscore | R Documentation |
Equivalent to centering and scaling with unit variance.
d_zscore(x, dim = c("rows", "cols"), axis = NULL, na.rm = FALSE)
x |
A |
dim |
Dimension over which to compute the z-score. |
axis |
Integer axis for N-d arrays (alternative to |
na.rm |
Logical; remove missing values when computing statistics. |
A delarr with the z-score applied lazily.
mat <- matrix(c(1, 2, 3, 10, 20, 30), nrow = 2, ncol = 3)
darr <- delarr(mat)
# Z-score normalize rows
zscored <- darr |> d_zscore(dim = "rows") |> collect()
zscored
# Row means should be ~0, row SDs should be ~1
rowMeans(zscored)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.