#' compute row-wise variance
#'
#' @param b (matrix)
#' @export
getVariance <- function(b) {
mu <- rowMeans(b)
n <- ncol(b)
if (any(is.na(b))) cat("NA detected ; removing for numerator\n")
# corrected sd estimator
x <- rowSums((b-mu)^2,na.rm=TRUE)/(n-1)
x
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.