Learn R Programming

reporttools (version 1.0.2)

eliminateNA: Eliminate all observations with at least one NA in a dataframe

Description

Generates two matrices: One with complete observations and one with all observations containing at least one missing value.

Usage

eliminateNA(dat)

Arguments

dat
Dataframe with observations in rows.

Value

  • completeDataframe containing complete observations.
  • incompleteDataframe containing observations with at least one NA.

Examples

Run this code
pat <- 1:10; var1 <- rnorm(10); var2 <- factor(round(rgamma(10, 2, 1)))
dat <- data.frame(cbind(pat, var1, var2))
dat[c(2, 8), 3] <- NA
eliminateNA(dat)

Run the code above in your browser using DataLab