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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of ermimi
Sent: Saturday, April 19, 2008 5:06 PM
To: r-help@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@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@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.

Reply via email to