R/rowVars.R

rowVars <-
  function(x, ...) {
    n <- NCOL(x)
    newn <- n - rowSums(is.na(x))
    val <-  (rowSums(x ^ 2, ...) - newn * rowMeans(x, ...) ^ 2) / (newn - 1)
    val <- replace(val, which((newn) < 2), NA)
    val
  }

Try the anapuce package in your browser

Any scripts or data that you put into this service are public.

anapuce documentation built on May 2, 2019, 9:44 a.m.