Java Mailing List Archive

http://www.r-help.com/

Home » R Help for Statistical Computing »

[R] read.xls: number of sheets

Lauri Nikkinen

2009-07-02

Replies: Find Java Web Hosting

Author LoginPost Reply
Hi,

I'm trying to read several Excel sheets from an Excel file into a
list. I'm using
read.xls from package 'gdata'. I would like to know how I can
check the number of sheets before the loop (in the example below) so
that I could adjust the loop counter? Any suggestions?

DF.list <- list()
for (i in 1:4) {
  DF.list[[i]] <- read.xls("sample_file.xls", sheet=i,
stringsAsFactors = FALSE)
  }

Thanks,
-L

______________________________________________
R-help@(protected)
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.
©2008 r-help.com - Jax Systems, LLC, U.S.A.