R/RemoveMissingData.R

Defines functions RemoveMissingData

Documented in RemoveMissingData

RemoveMissingData <-
function(x) {
  # 
  # Listwise deletion of missing data.
  #
  # Args:
  #   x: Data (matrix).
  #
  # Returns:
  #   Data after listwise deletion of missing data (matrix).
  # 
  n <- dim(x)[1]
  y <- na.omit(x)
  n.y <- dim(y)[1]
  if (n.y < n) {
    cat("  * ", n - n.y, " cases (", round(100 * (n - n.y) / n, 1), 
        "%) contained missing data;\n    ", n.y, " out of ", n, " cases (", 
        round(100 * n.y / n, 1), "%) retained for analysis\n", sep = "")
  }
  return(y)
}

Try the RTaxometrics package in your browser

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

RTaxometrics documentation built on May 31, 2023, 8:29 p.m.