How to remove missing line?


I have a database that has some missings (NA's), but in only one variable (a column), and I need to remove the entire row that has the missing.


To remove rows with no data in R, you must use the complete.cases() function.

For example in a dataset {x}:

y <- x[complete.cases(x),]

The complete.cases(x) is a logical vector that will return TRUE for rows with data and FALSE for rows without data.

Scroll to Top