Delete rows with empty cells from Excel using R
Practically during any survey for data collection, getting all the information from all units is not possible as sometimes we get partial information and sometimes nothing. Therefore, it is possible that some rows in our data are completely blank and some might have partial data. The blank rows can be removed and the other empty values can be filled with methods that help to deal with missing information.
Also, reading the excel file with some empty cells may also produce errors sometimes, which ultimately affect the model accuracy. Therefore, the removal of empty cells is an important process.
To remove rows with empty cells we have a syntax in the R language, with which it is very easier for the user to remove as many numbers of empty rows in the excel file.
- Import data
- Select rows with empty cells
- Delete such rows
- Copy to original data frame
data <- data[!apply(data == “”, 1, all),]
File in use: