如何解决将受密码保护的 xlsx 文件导入 R
我发现一个旧线程 (How do you read a password protected excel file into r?) 建议我使用以下代码读取受密码保护的文件:
install.packages("excel.link")
library("excel.link")
dat <- xl.read.file("TestWorkbook.xlsx",password = "pass",write.res.password="pass")
dat
但是,当我尝试这样做时,我的 R 立即崩溃了。我试过删除 write.res.password 参数,这似乎不是问题。我有一种预感,excel.link 可能不适用于最新版本的 R,因此如果您知道任何其他方法可以做到这一点,我将不胜感激。
编辑:使用 read.xlsx 生成此错误:
Error in .jcall("RJavaTools","Ljava/lang/Object;","newInstance",.jfindClass(class),:
org.apache.poi.poifs.filesystem.OfficeXmlFileException:
The supplied data appears to be in the Office 2007+ XML.
You are calling the part of POI that deals with OLE2 Office Documents.
You need to call a different part of POI to process this data (eg XSSF instead of HSSF)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。