Delete rows with empty cells from Excel using R Last Updated : 05 Apr, 2021 Summarize Comments Improve Suggest changes Share Like Article Like Report 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. Steps - Import dataSelect rows with empty cellsDelete such rowsCopy to original data frame Syntax: data <- data[!apply(data == "", 1, all),] Example 1: File used: R gfg_data=read.csv('input_gfg.csv') gfg_data <- gfg_data[!apply(is.na(gfg_data) | gfg_data == "", 1, all),] print(gfg_data) Output: Example 2: File in use: R library(readxl) gfg_data <- read_excel("Data_gfg.xlsx") print("original dataset:-") print(gfg_data) gfg_data <- gfg_data[!apply(is.na(gfg_data) | gfg_data == "", 1, all),] print("Modified dataset:-") print(gfg_data) Output: Comment More infoAdvertise with us Next Article How to Delete a File using R GeeksforGeeks Improve Article Tags : R Language R-Excel Similar Reads How to Delete Blank Columns in Excel Empty columns in your Excel spreadsheet can make it look messy and also look unprofessional. Now, whether you are doing a budget analysis, sorting data, or making a report, removing blank columns is a way to make your report professional and cleaner. Now, if you are new to MS Excel and want to know 5 min read Write Data Into Excel Using R In this article, we will discuss how to write data into excel using R Programming Language. To write data into excel,  we must leverage a package called xlsx in R. The excel package is a java based language that is powerful to read, write and update data from and to excel files. Syntax: write.xlsx( 2 min read Remove Rows with NA Using dplyr Package in R NA means Not Available is often used for missing values in a dataset. In Machine Learning NA values are a common problem and if not treated properly can create severe issues during data analysis. NA is also referred as NaN which means Not a number.Dplyr package in R is a popular package for Data man 4 min read How to Delete Pages in Excel In Excel, the concept of "pages" typically refers to worksheets, print areas, or extra blank spaces that may clutter your file. Whether youâre looking to clean up your workbook, remove unwanted sheets, or delete unnecessary print areas, knowing how to delete pages in Excel is essential for maintaini 3 min read How to Delete a File using R In this article, we will discuss how to delete a file in R Programming Language. Directory in use: Method 1: Using file.remove() This is the simplest approach to delete a file as in this approach the user just needs to call the file.remove() function which is a bases function of the R programming la 2 min read Skip Rows While Using read_excel or read.excel in R When importing data from Excel files in R, you often encounter situations where certain rows are irrelevant to your analysis and should be skipped. This could be due to header rows, metadata, or other non-data rows. R provides several methods to handle this using packages like readxl and openxlsx. T 4 min read Like