I have been trying to read the excel file but seems like there is something wrong. The file is stored in Documents folder in excel format.
These are the error messages that I get :
table <- read.csv(file.choose(),header=T,sep='\t')
Warning messages:
1: In read.table(file = file, header = header, sep = sep, quote = quote, :
line 1 appears to contain embedded nulls
2: In read.table(file = file, header = header, sep = sep, quote = quote, :
incomplete final line found by readTableHeader on
also, since these were warnings , I happened to ignore them. But nothing has been read into "table" either:
table
# [1] PK...
# <0 rows> (or 0-length row.names)
read.csv
doesn't read XLS(X) files, only CSV files. Try opening your Excel file in Excel, exporting it to CSV and reissuing your read.csv
command (depending on your system language, you might want to use read.csv2
instead).
I had a similar error, e.g:
A <- read.csv("tel.csv", sep = ",")
Error in read.table(file = file, header = header, sep = sep, quote = quote, :
empty beginning of file
In addition: Warning messages:
1: In read.table(file = file, header = header, sep = sep, quote = quote, :
invalid input found on input connection 'tel.csv'
2: In read.table(file = file, header = header, sep = sep, quote = quote, :
line 1 appears to contain embedded nulls
3: In read.table(file = file, header = header, sep = sep, quote = quote, :
incomplete final line found by readTableHeader on 'tel.csv'
For solution I tried:
A <- read.csv("tel.csv", sep = ",",
fileEncoding="utf-16")
It worked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With