R/show.cols.with.na.R

Defines functions show.cols.with.na

Documented in show.cols.with.na

show.cols.with.na <-
function(x) {
  if (class(x) != "data.frame") 
    stop("x must be a dataframe.\n")
  missing.by.column <- apply(is.na(x), 2, sum)
  if (sum(missing.by.column) == 0) {
    cat("No missing values.\n")
  } else {
    missing <- which(missing.by.column > 0)
    return(missing.by.column[missing])
  }
}

Try the FAwR package in your browser

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

FAwR documentation built on Jan. 13, 2021, 7:45 a.m.