问题描述
我正在尝试在R中打开.xlsb文件,并不断收到类似错误.
I'm trying to open an .xlsb file in R and keep getting similar errors.
关于如何解决此问题的任何建议,而不必下载数据并将其保存在其他格式中?
Any recommendations on how to solve this issue without having to download the data and save it in a different formate?
read.xlsx(paste(OutputLocation,FileName, sep=""), sheetName = "Master Data")
错误消息:.jcall("RJavaTools","Ljava/lang/Object;","invokeMethod",cl,中的错误: org.apache.poi.xssf.XLSBUnsupportedException:不支持.XLSB二进制工作簿
Error messages:Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, : org.apache.poi.xssf.XLSBUnsupportedException: .XLSB Binary Workbooks are not supported
rigDataWB<-loadWorkbook(paste(OutputLocation,FileName, sep=""))
错误消息:错误:XLSBUnsupportedException(Java):不支持.XLSB二进制工作簿
Error messages:Error: XLSBUnsupportedException (Java): .XLSB Binary Workbooks are not supported
请注意:
我无法安装Perl库.
I cannot install Perl libraries.
我正在运行64位R.
参考: http://www.milanor.net/blog/?p=779
我的数据来自: http://phx.corporate-ir.net/phoenix.zhtml?c= 79687& p = irol-reportsother
推荐答案
使用RODBC
包:
library(RODBC)
wb <- "D:\\Data\\Masked Data.xlsb" # Give the file name
con2 <- odbcConnectExcel2007(wb)
data <- sqlFetch(con2, "Sheet1$") # Provide name of sheet
nrow(data)
这篇关于如何在R中打开.xlsb文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!