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 (!(is.data.frame(x)))
    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 June 22, 2025, 5:07 p.m.