Skip to content

How to use read.xls in R

4 messages · Lisa Wang, Sundar Dorai-Raj, Gabor Grothendieck +1 more

#
Hello there,

In gdata package, read.xls is to be used for reading excel data (from
windows). 
The following is my code:('C:/session/sampledata.xls' is where the file
is stored)

data1<-read.xls('C:/session/sampledata.xls',sheet=1)

and I got the following error message:
Error in system(cmd, intern = !verbose) : perl not found

Could you please tell me what I have done wrong and how I should do it?

Thanks a lot

Lisa Wang 
Princess Margaret Hospital, Toronto, Ca
tel:416 946 4551
#
Lisa Wang said the following on 12/7/2006 3:01 PM:
Please reread ?read.xls. Quote from the "Note" section:

"Either a working version of Perl must be present in the executable 
search path, or the exact path of the perl executable must be provided 
via the perl argument. See the examples below for an illustration."

You need to install perl.

http://www.activestate.com/Products/ActivePerl/Download.html

HTH,

--sundar
#
You need perl installed for it to work.
Although you normally would not need to use them note the
verbose= and perl= arguments on the read.xls command.

If you don't want to install perl try using RODBC:

      library(RODBC)
      z <- odbcConnectExcel("/a.xls")
      dd <- sqlFetch(z,"Sheet1")
      close(z)
On 12/7/06, Lisa Wang <lisawang at uhnres.utoronto.ca> wrote:
#
Or alternatively you can use xlsReadWrite package

install.packages(xlsReadWrite)
library(xlsReadWrite)
read.xls("sampledata.xls")

Regards,

Francisco

Dr. Francisco J. Zagmutt
College of Veterinary Medicine and Biomedical Sciences
Colorado State University
Gabor Grothendieck wrote: