简体   繁体   中英

Reading multiple worksheets into data frame(s) in R

I have multiple workbooks with multiple worksheets. In each worksheet, the data starts from a different row number, but can be identified when "ABCD" occurs in the 1st column. I want to apply a function/calculation to each worksheet. However, as the first step, I cannot read in the workbook as a data frame. Tried XLConnect but getting the following error

*(Error in ls(envir = envir, all.names = private) : 
  invalid 'envir' argument*

My question is how do I read the data from each worksheet into a data frame?

Try the RODBC package http://cran.r-project.org/package=RODBC

See also: http://cran.r-project.org/doc/manuals/r-release/R-data.html#Reading-Excel-spreadsheets

XLConnect doesn't work on large EXCEL files. I used RODBC to get it working. See code in the following link if interested. Here's the link:

( Read data from several worksheets from workbook and eliminate comments ).

Make sure that the R version, Operating system and MS Office versions (64 bit or 32-bit) are identical.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM