Learn R Programming

SciencesPo (version 1.02.12)

eliminateNA: Eliminate NA observations

Description

Generates two matrices: One with complete observations and the other with all observations.

Usage

eliminateNA(data)

Arguments

data
the data.frame

Value

  • two matrices.

encoding

UTF-8

Examples

Run this code
id <- 1:10; var1 <- rnorm(10); var2 <- rgamma(10, 2, 1);
df <- data.frame(cbind(id, var1, var2))
df[c(5, 9), 3] <- NA
eliminateNA(df)

Run the code above in your browser using DataLab