Getting an error when I use read.xls function of gdata package in R

305 Views Asked by At
Error in read.table(file = file, header = header, sep = sep, quote = quote,  : 
  no lines available in input

This is the error in the console. But I haven't used read.table? Is it an internal reference?

1

There are 1 best solutions below

0
neilfws On

You can view the code by typing read.xls or in RStudio, View(read.xls).

gdata::read.xls works by first converting the Excel file to a tab or comma-delimited file. It then uses either read.delim or read.csv to read the data. Both of those functions are wrappers to read.table.

So yes: the function is using read.table internally.

Your next problem is to figure out why the conversion results in a file with no lines. It may be better to use a more modern solution such as the readxl package, or explore the Excel import interactively in RStudio.