R/abmi.na.exclude.R

Defines functions abmi.na.exclude

Documented in abmi.na.exclude

abmi.na.exclude <-
function(x, value = NA, na.char=c("NA", "VNA", "DNC", "PNA", "SNI"))
{
   if (NCOL(x) == 1) {
       i <- which(!abmi.is.na(x, na.char))
       j <- which(abmi.is.na(x, na.char))
       x <- x[i]
   } else {
       i <- which(apply(abmi.is.na(x, na.char), 1, sum) == 0)
       j <- which(apply(abmi.is.na(x, na.char), 1, sum) != 0)
       x <- x[i,]
   }
   attr(x, "na.action") <- j
   class(attr(x, "na.action")) <- "exclude"
   return(x)
}

Try the abmiOld package in your browser

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

abmiOld documentation built on May 2, 2019, 5:54 p.m.