Unable to read .xls file in R


Hi All,
i downloaded a file from UCI repository.(below link)

I am unable to import it in R
I tried ," read.table" , “read.xlsx” , but was unable to read it.
I got following warning “incomplete final line found by readTableHeader”

I tried googling this error a lot , but was unable to find a solution which would help me read this file successfully in R.
Please help


@Rishabh0709, I can load the file just fine using the code below:

data <- read.xlsx('default of credit card clients.xls',
                  sheetName = 'Data', startRow = 2)

However, I think it’s better to open the file in a spreadsheet software and export it to CSV, since read.xlsx() is very slow. Then you can just use read.csv() or fread() from the data.table package as usual.


thanks @caiotaniguchi :slight_smile:


The readxl package makes it easy to get data out of Excel and into R. Compared to many of the existing packages (e.g. gdata, xlsx, xlsReadWrite) readxl has no external dependencies, so it’s easy to install and use on all operating systems.

data<-read_excel("default of credit card clients.xls", sheet = "Data",skip = 1)