powered by
Variance of features in rows
rowVars(x, na.rm = TRUE)
A numeric vector of length nrow(x) with the row-wise variances.
nrow(x)
Numeric matrix
Logical. Should missing values (including NaN) be omitted from the calculations?
myVal <- matrix(1:9, nrow=3, byrow=FALSE) myVar <- rowVars(myVal) stopifnot(identical(myVar, c(9,9,9)))
Run the code above in your browser using DataLab