[R] there is no "xls" reader in R?

Johnsons johnsons at nosnhoj.org
Fri Apr 21 16:25:13 CEST 2006


I have used the following successfully:

xls = odbcConnectExcel(fname)
Rawdata.temp = sqlQuery( chan, "select * from [sheet1$]", max=2800 )
close(xls)

Presuming your data is in the Excel tab "sheet1".

Of course, this assumes that column headers are in the first row.

Greg Johnson

 

> -----Original Message-----
> From: roger bos [mailto:roger.bos at gmail.com] 
> Sent: Thursday, April 20, 2006 6:14 AM
> To: Ko-Kang Kevin Wang
> Cc: R-help at stat.math.ethz.ch
> Subject: Re: [R] there is no "xls" reader in R?
> 
> I like to use the RODBC package for doing this.  Here is my 
> code sample:
> 
>         xls <-  odbcConnectExcel(fname)
>         rawdata.temp <-  sqlFetch(xls, "rawdata", max=2800)
>         close(xls)
> 
> fname is the full path to the file and "rawdata" is the name 
> of the excel sheet I want to import.  I tried one other 
> approach (I think it was read.xls()) and that approach used 
> perl scripts to read in the xls file and was very slow.  
> RODBC is very fast and has always worked great for me.  
> Haven't tried any of the other ways mentioned.
> 
> 
> 
> On 4/20/06, Ko-Kang Kevin Wang <Kevin.Wang at maths.anu.edu.au> wrote:
> >
> > Have a look at the read.xls() in gdata package.
> >
> > HTH,
> >
> > Kevin
> >
> > Michael wrote:
> > > Currently I have to convert all my "xls" into "csv" before I can 
> > > read it
> > in
> > > and process the excel data in R...
> > >
> > > Is there a way to directly read in "xls" data?
> > >
> > > Thanks a lot!
> > >
> > >       [[alternative HTML version deleted]]
> > >
> > > ______________________________________________
> > > 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
> >
> > --
> > Ko-Kang Kevin Wang
> > Homepage: http://wwwmaths.anu.edu.au/~wangk/
> > Ph (W): +61-2-6125-2431
> > Ph (H): +61-2-6125-7471
> > Ph (M): +61-40-451-8301
> >
> > ______________________________________________
> > 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
> >
> 
> 	[[alternative HTML version deleted]]
> 
> 
>




More information about the R-help mailing list