R/rm.zero.cols.R

Defines functions rm.zero.cols

Documented in rm.zero.cols

rm.zero.cols = function(xx, eps=10^(-12)) {
  n = ncol(xx)
  vv = NULL
  for(i in 1:n) {
    if(sum(abs(xx[,i])) < eps) {
      vv = c(vv, i)
    }
  }
  if(is.null(vv)) {
    return(xx)
  } else {
    return(xx[,-vv])
  }
}

Try the snm package in your browser

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

snm documentation built on Nov. 8, 2020, 8:11 p.m.