I am attempting to follow this easy 2-minute video tutorial on importing an Excel spreadsheet into R as a data frame: http://www.screenr.com/QiN8
I followed each step, i
As some other answers say already the problem is that perl.exe is missing. In my case it worked after getting it installed from: http://www.activestate.com/activeperl/downloads and then point to it:
read.xls("bla.xlsx", perl = "C:\\Perl64\\bin\\perl.exe")
R is searching for the xls or xlsx file, but is not finding it. So set the working directory where your Excel file is located (e.g. setwd("C:\....")
) and run any of these script formats:
read.xls("Potato.xls", perl = "C:\\Strawberry\\perl\\bin\\perl.exe")
read.xls("Tomato.xls", perl = "C:\\Strawberry\\perl\\bin\\perl.exe")
read.xls("Potato.xlsx", perl = "C:/Strawberry/perl/bin/perl.exe")
read.xls("Tomato.xlsx", perl = "C:/Strawberry/perl/bin/perl.exe")
The problem went away after I ran the following script and restarted the PC:
library(gdata)
installXLSXsupport(perl = 'C:\\strawberry\\perl\\bin\\perl.exe')
I have recently got the same problem with gdata
package and Strawberry Perl software under Windows 10. The solution in my case is as follows: (1) uninstall an old version of the Strawberry Perl -- if you try to install new version over the old one, it says that it is not upgradable, (2) install a new version downloaded from this link to C:/Strawberry/
, (3) add C:/Strawberry/perl/bin/perl.exe
to 'Path' in User variables of the Environment Variables window.
I also meet the same issue and had been fighting with "error in xls2sep" for 1 hour. to re-install strawberry, does not work.
I finally found out that the excel file was broken. "error in xls2sep" seems to mean the file is broken.
Ning
After loading the gdata package using library(gdata)
it clearly says:
gdata: read.xls() will be unable to read Excel XLS and XLSX files gdata: unless the 'perl=' argument is used to specify the location of a gdata: valid perl intrpreter.
So, you need the PATH to the valid perl interpreter. Using windows, as is the case here, you need to check the properties to locate the required perl interpreter.
#set the PATH to perl interpreter
perl <- "C:/strawberry/perl/bin/perl5.18.2.exe"
try1file <- read.xls("my.one.filename.xls", perl = perl)
For multiple xls files:
> length(list.files())
[1] 65
try65files <- lapply(list.files(), ..., perl = perl)
If verbose = TRUE
, at the end of each file it will read:
Loading 'F65.xls'...
Done.
Orignal Filename: F65.xls
Number of Sheets: 1
Writing sheet number 1 ('Sheet1') to file 'C:\Users\FRANKL~1.JOH\AppData\Local\Temp\RtmpeKs3fi\file13dc750950e4.csv'
Minrow=0 Maxrow=32 Mincol=0 Maxcol=16
(Ignored 0 blank lines.)
0
Done.
Reading csv file “C:\Users\FRANKL~1.JOH\AppData\Local\Temp\RtmpeKs3fi\file13dc750950e4.csv” ...
Done.