Re: [R] read file of EXCEL format

From: Chuck Cleland <ccleland_at_optonline.net>
Date: Fri 24 Feb 2006 - 00:37:42 EST

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

______________________________________________
R-help@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
Received on Fri Feb 24 01:03:33 2006

This archive was generated by hypermail 2.1.8 : Fri 24 Feb 2006 - 03:08:45 EST