xlconnect

How to extract sheet names from Excel file in R

旧街凉风 提交于 2019-11-26 23:13:04
问题 I have loaded a workbook into R and read in the worksheets using xlConnect, but I was wondering if there was a way of extracting the names of the sheets perhaps in a vector? So far my code is: dataIn<-loadWorkbook(file.path(filenames[1],sep="")) lst = readWorksheet(dataIn, sheet = getSheets(dataIn), startRow=1, startCol=1, header=TRUE) ...and I want to extract the sheet names of the sheets in lst . 回答1: You are looking for getSheets Returns all worksheet names in a workbook. 回答2: Another

Read all worksheets in an Excel workbook into an R list with data.frames

爱⌒轻易说出口 提交于 2019-11-26 14:15:27
I understand that XLConnect can be used to read an Excel worksheet into R. For example, this would read the first worksheet in a workbook called test.xls into R. library(XLConnect) readWorksheetFromFile('test.xls', sheet = 1) I have an Excel Workbook with multiple worksheets. How can all worksheets in a workbook be imported into a list in R where each element of the list is a data.frame for a given sheet, and where the name of each element corresponds to the name of the worksheet in Excel? Updated answer using readxl (22nd June 2015) Since posting this question the readxl package has been

Read all worksheets in an Excel workbook into an R list with data.frames

谁说我不能喝 提交于 2019-11-26 03:06:13
问题 I understand that XLConnect can be used to read an Excel worksheet into R. For example, this would read the first worksheet in a workbook called test.xls into R. library(XLConnect) readWorksheetFromFile(\'test.xls\', sheet = 1) I have an Excel Workbook with multiple worksheets. How can all worksheets in a workbook be imported into a list in R where each element of the list is a data.frame for a given sheet, and where the name of each element corresponds to the name of the worksheet in Excel?