Re: [R] read.xls and name of worksheet

2009-03-12 Thread Gabor Grothendieck
Here is a program that will get a list of the sheet names and then read in the indicated name. Modify to suit. library(rcom) xls <- "C:\\test.xls" oxl <- comCreateObject('Excel.Application') comSetProperty(oxl, "Visible", TRUE) owb <- comGetProperty(oxl, "Workbooks") ob <- comInvoke(owb, "Open",

[R] read.xls and name of worksheet

2009-03-12 Thread Juergen Rose
Hi, I would like to some excel files with some worksheets. I tried this with the following R script: library(gdata) i<-1 rc<-0 while(rc != "try-error") { wksh<-try(read.xls("cluster-microarray-FW.xls",sheet=i,verbose=TRUE,perl="perl")) rc<-class(wksh) print(sprintf("--- i=%2d rc=%s -