[R] Excel *.xls files, RODBC

Tobias Verbeke tobias.verbeke at telenet.be
Sat Dec 4 19:46:27 CET 2004


On Sat, 4 Dec 2004 14:32:24 -0400 (AST)
Rolf Turner <rolf at math.unb.ca> wrote:

> Chuck Cleland wrote:
> 
> > The following works for me under WinXP Pro to create "myframe" as a 
> > data frame:
> > 
> > library(RODBC)
> > z <- odbcConnectExcel("c:/myfolder/mydata.xls")
> > myframe <- sqlFetch(z, "Sheet1")
> > close(z)
> 
> I tried that and got the error message:
> 
> Error: couldn't find function "odbcConnectExcel"
> 
> > Are you indicating the name of the worksheet you want within the
> > *.xls file?  I suspect there could be additional issues on a
> > non-Windows OS that I don't know about.
> 
> On which Brian Ripley commented:
> 
> > Most notably the absence of an Excel ODBC driver.
> 
> I guess that's the problem.  In my initial message I forgot to
> indicate that I am working on a Linux box.  Sorry; mea culpa.
> 
> It would appear then, that there is NO WAY to read Excel files into R
> save by transporting them to a Windoze system, saving them as .csv
> files and then transporting these back reading them into R.  A bit
> unsatisfactory, but it ***is*** a workaround.

library(gdata)
?read.xls

HTH,
Tobias




More information about the R-help mailing list