Joelle
4/26/2018 - 12:15 PM

Remove NA rows

Remove rows with all or at least one NA

# Remove all rows with all NA's
data[rowSums(is.na(data)) != ncol(data),]

# Remove rows with at least one NA
data[rowSums(is.na(data)) == 0,] 

# Remove rows from a dataframe based on a specific column with NA's 
data[complete.cases(data$column),]