如何从R中的Excel文件中提取工作表名称 [英] How to extract sheet names from Excel file in R
本文介绍了如何从R中的Excel文件中提取工作表名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
到目前为止,我的代码是:
dataIn< -loadWorkbook(file.path(filenames [1],sep = ))
lst = readWorksheet(dataIn,sheet = getSheets(dataIn),startRow = 1,startCol = 1,header = TRUE)
...我想在 lst
中提取工作表的工作表名称。
解决方案
您正在寻找 getSheets
返回工作簿中的所有工作表名称。
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
.
解决方案
You are looking for getSheets
Returns all worksheet names in a workbook.
这篇关于如何从R中的Excel文件中提取工作表名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文