According to This link which have similar issue.

From the link, it mentioned we should set the perl manually.

i do found perl file under the gdata packages folders.

For details the error message is shown below.

> list.files()
[1] "fwfdata1.txt"   "fwfdata2.txt"   "txtdata1.txt"   "txtdata2.txt"   "txtdata3.txt"   "txtdata4.txt"  
[7] "xlsdata1.xls"   "xlsxdata1.xlsx"
> #xls data1 - gdata
> 
> library(gdata)
> path <- "xlsdata1.xls"
> data8 <- read.xls(path, sheet=1, verbose=FALSE)
Error in findPerl(verbose = verbose) : 
  perl executable not found. Use perl= argument to specify the correct path.
Error in file.exists(tfn) : invalid 'file' argument

So i would like to know how i should set the perl statement. Besides perl issue, it also appears file.exists(tfn) problem.

有帮助吗?

解决方案

Do one of the following:

1) perl argument Use the perl= argument as indicated in the error message. First make sure that you did install perl. Then assuming a Microsoft Windows environment and that perl was installed in C:\Perl64 (so that perl.exe is found at C:\Perl64\bin\perl.exe) then it would be:

read.xls(path, sheet=1, verbose=FALSE, perl="C:\\Perl64\\bin\\perl.exe")

or the same but with forward slashes: "C:/Perl64/bin/perl".

2) set path If you don't want to specify perl= each time then with the same assumptions regarding the location of perl on your system, ensure that C:\Perl64\bin is on your Windows path. If you have done this correctly then from the Windows cmd line this should find perl:

where perl

The Windows path can be set through the Windows control panel. If you do that then the read.xls statement you used should work.

Other OS If you are not using Windows then take analogous steps to either specify the perl argument or ensure that perl is on your path.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top