Re: [R] Re ad From EXCEL

From: Lucke, Joseph F <Joseph.F.Lucke_at_uth.tmc.edu>
Date: Mon, 21 Apr 2008 13:11:04 -0500

fp0 = "C:\\Documents and Settings\\myname\\My Documents\\Research\\"   #upper file path
fp1 = "PIname\\PIproject\\Working00\\"					     #middle file path	
fp2 = "DateData\\Dates.xls"							     #lower file path
dbase = file.path(paste(fp0,fp1,fp2, sep=""))				     #create complete file path by paste-ing them together
varList = "ID, ADM_DATE, DISCHARGE_DATE, ICU_DATE, TRANSFER_DATE, READMIT_ICU" 	#make variable list
varType = c(rep(T,5),F)									#I forget what this was for
ch0 = odbcConnectExcel(dbase)								#open channel ch0

#odbcGetInfo(ch0) #check for channel infoirmattion
#sqlTables(ch0) #check data information
Dates.data = sqlQuery(ch0, paste("SELECT", varList, "FROM A"), as.is=varType ) #get the data from XL sheet "A" (Here data happens to be dates, another complication, but ignored here) close(ch0) #close channel

#data now stored in Dates.data

Joe

-----Original Message-----
From: r-help-bounces_at_r-project.org [mailto:r-help-bounces_at_r-project.org] On Behalf Of ermimi Sent: Saturday, April 19, 2008 5:06 PM
To: r-help_at_r-project.org
Subject: [R] Re ad From EXCEL

Hello!!!

I have been read a much about as read data from Excel File, but I havenīt found the necesary information to read the data. Now, I can create a channel : channel <- odbcConnectExcel("file.xls") but I donīt know as read the data??

I hope that you could help me. Thank you very much.

--
View this message in context: http://www.nabble.com/Read-From-EXCEL-tp16787900p16787900.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Mon 21 Apr 2008 - 18:15:21 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 21 Apr 2008 - 18:30:30 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive