XinMeng wrote:> Hello sir: > > How can I read data file of EXCEL format from disk("d:\\data.XLS" for example)? > > I can only read data file of .txt format > read.delim("d:\\data.txt",header=T,as.is=T),but only EXCEL format is available at present.Here is one way to read it directly: library(RODBC) z <- odbcConnectExcel("d:/data.xls") mydata <- sqlFetch(z, "Sheet1") close(z) # Replace Sheet1 with the name of the worksheet to be read. -- Chuck Cleland, Ph.D. NDRI, Inc. 71 West 23rd Street, 8th floor New York, NY 10010 tel: (212) 845-4495 (Tu, Th) tel: (732) 452-1424 (M, W, F) fax: (917) 438-0894
http://cran.r-project.org/doc/manuals/R-data.html#Reading-Excel-spreadsheets On 2/23/06 8:49 AM, "XinMeng" <xmeng at capitalbio.com> wrote:> > Hello sir: > > How can I read data file of EXCEL format from disk("d:\\data.XLS" for > example)? > > I can only read data file of .txt format > read.delim("d:\\data.txt",header=T,as.is=T),but only EXCEL format is available > at present.Reading the manual is quite helpful for such things: http://cran.r-project.org/doc/manuals/R-data.html#Reading-Excel-spreadsheets Sean
Please see the 'R Data Import/Export Manual' which ships with every copy of R. On Thu, 23 Feb 2006, XinMeng wrote:> Hello sir: > > How can I read data file of EXCEL format from disk("d:\\data.XLS" for example)? > > I can only read data file of .txt format > read.delim("d:\\data.txt",header=T,as.is=T),but only EXCEL format is available at present.> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.htmlPLEASE do! -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Hello sir: How can I read data file of EXCEL format from disk("d:\\data.XLS" for example)? I can only read data file of .txt format read.delim("d:\\data.txt",header=T,as.is=T),but only EXCEL format is available at present. Thanks a lot
hi, hi all, there are several possibilities to import data in Excel format. you can use the fonctions "odbcConnectExcel","read.xls", ... (see http://cran.r-project.org/doc/manuals/R-data.html) require(RODBC) ?odbcConnect library(gdata) ?read.xls regards, P.BADY Selon XinMeng <xmeng at capitalbio.com>:> > Hello sir: > > How can I read data file of EXCEL format from disk("d:\\data.XLS" for > example)? > > I can only read data file of .txt format > read.delim("d:\\data.txt",header=T,as.is=T),but only EXCEL format is > available at present. > > > Thanks a lot > > ______________________________________________ > 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 > >-------------------------------------------------------------------------- Ce message a ??t?? envoy?? depuis le webmail IMP (Internet Messaging Program)