[R] Excel *.xls files, RODBC

Berton Gunter gunter.berton at gene.com
Mon Dec 6 17:55:55 CET 2004


Folks: 

An additional issue is that worksheet names must conform to ODBC/SQL
standards; so, for example, Excel permits worksheet names with embedded
spaces, but RODBC does not handle them (or at least, I was not able to get
to to do so), as this is not permitted in the standards. 

-- Bert Gunter
Genentech Non-Clinical Statistics
South San Francisco, CA
 
"The business of the statistician is to catalyze the scientific learning
process."  - George E. P. Box
 
 

> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch 
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Chuck Cleland
> Sent: Saturday, December 04, 2004 7:10 AM
> To: Rolf Turner
> Cc: r-help at stat.math.ethz.ch
> Subject: Re: [R] Excel *.xls files, RODBC
> 
>    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)
> 
>    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.
> 
> hope this helps,
> 
> Chuck Cleland
>




More information about the R-help mailing list