简体   繁体   English

如何删除第一张表或读取第二张excel文件

[英]How to remove the first sheets or read the second sheets of the excel files

I have very unusual and incomprehensible predicament with deleting the first sheets and reading the second sheets of the excel files that I have. 我有一个非常不寻常和难以理解的困境,删除第一张纸和阅读我有的第二张excel文件。

I thought I knew perfectly how to read the second sheet of an excel file: read.xlsx2("excelfile.xlsx", SheetIndex = 2) or read.xlsx2("excelfile.xlsx", SheetName = "secondsheetsname") 我以为我完全知道如何阅读excel文件的第二张: read.xlsx2("excelfile.xlsx", SheetIndex = 2)read.xlsx2("excelfile.xlsx", SheetName = "secondsheetsname")

But everytime I do this, this keeps showing up and its been pain in my arse since I have many of these excel files and need to read their second sheets. 但每次我这样做,这一直在出现,我的屁股很痛苦,因为我有很多这些excel文件,需要阅读他们的第二张。

我尝试了read.xlsx和read.xlsx2。由于第一张表中没有任何内容,因此在读取时会显示“NULL”

I need to read the second sheets of many excel files. 我需要阅读许多excel文件的第二张。 Could anyone help me to read the second sheet or enlighten me with deleting the first sheets of the excel files at once or automatically by using R ? 任何人都可以帮我阅读第二张或启发我立即删除第一张excel文件或使用R自动删除?

Ive attached some of the files in order to let everyone to try. 我附上了一些文件 ,以便让大家尝试。

After having tested several solutions to import Excel files into R, I can recommend the readxl package: 在测试了几个将Excel文件导入R的解决方案后,我可以推荐readxl包:

require(readxl) read_excel('excelfile.xlsx', sheet = 2) require(readxl) read_excel('excelfile.xlsx', sheet = 2)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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