将XLSX电子表格读取到R中时包括空列?
我正在使用XLSX软件包读取.xlsx文件,而不包含任何条目的列没有被捕获(跳过)。
代码:
wb <- loadWorkbook(".xlsx")
sheet1 <- getSheets(wb)[[2]]
rows <- getRows(newsheet)[2:3]
headerdata <- getCells(rows[1]) %>% lapply(., getCellValue) %>% as.data.frame()
rowdata <- getCells(rows[2])%>% lapply(., getCellValue) %>% as.data.frame()
names(rowdata) <- headerdata [RECEIVES ERROR MESSAGE 'names' attribute [17] must be the same length as the vector [14]]
任何输入都将不胜感激。
I am using XLSX package to read an .xlsx file, the columns that do not contain any entries are not being captured (skipped).
code:
wb <- loadWorkbook(".xlsx")
sheet1 <- getSheets(wb)[[2]]
rows <- getRows(newsheet)[2:3]
headerdata <- getCells(rows[1]) %>% lapply(., getCellValue) %>% as.data.frame()
rowdata <- getCells(rows[2])%>% lapply(., getCellValue) %>% as.data.frame()
names(rowdata) <- headerdata [RECEIVES ERROR MESSAGE 'names' attribute [17] must be the same length as the vector [14]]
Any inputs would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论