[R] How to read an excel data into R?

roger bos roger.bos at gmail.com
Thu Jun 23 14:29:40 CEST 2005


This is really great.  I use odbc for sql all the time, but I never
needed to read in excel files before.  I needed to yesterday and I
looked at read.xls() from library(gdata) and it took 5-10 minutes to
read in the file and odbc did it in 5 seconds!

I guess that is the good thing about having duplication in function in
R, we can try several methods and choose which one is best/fastest. 
Thanks for the example.

On 6/23/05, Patrick Hausmann <c18g at zfn.uni-bremen.de> wrote:
> Hi,
> 
> you can use the library "RODBC" to import Excel-Files. This works for me:
> 
> #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> library(RODBC)
> setwd("C:\\R1B2")
> channel <-  odbcConnectExcel("pk2003.xls")
> tab     <-  sqlFetch(channel, "Tabelle3")
> #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> HTH
> Patrick
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list