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

roger bos
Thu, 23 Jun 2005 12:29:40 -0000

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