User Tools

Site Tools


mean_without_zeros
nzmean <- function(x) {
  zvals <- x==0
  if (all(zvals)) 0 else mean(x[!zvals])
}
mean_without_zeros.txt · Last modified: 2015/12/16 13:26 by vincenzo