使用R包“repmis”读取Dropbox的xlsx文件时出错

时间:2021-08-14 07:37:56

I need to be able to read a sheet from an xlsx workbook into R for use in a Shiny app. (I know it should be a csv file, but that is unfortunately not my decision...).(Edited to add: The file I need to read is on dropbox) I am trying to use the repmis package. The code I have tried is simply:

我需要能够从xlsx的工作簿中读取一个文件,并在一个闪亮的应用程序中使用R(我知道它应该是一个csv文件,但不幸的是,这不是我的决定…)。(编辑为添加:我需要阅读的文件在dropbox上)我正在尝试使用repmis包。我尝试过的代码很简单:

library('repmis')
library('xlsx')
lnk<-"https://www.dropbox.com/s/pzyt86pguko3xg6/TestBook.xlsx?dl=0"
my_data<-source_XlsxData(lnk, sheet="MainData", startRow=1)

Unfortunately I get the following error message:

不幸的是,我得到以下错误信息:

Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl,  :
java.lang.IllegalArgumentException: Your InputStream was neither an OLE2 stream, nor an OOXML stream

I have no idea what it means... :|

我不知道这是什么意思……:|

1 个解决方案

#1


1  

I think a recent update removed the ability to read data files stored on Dropbox from within R. I will go look for confirmation, and delete my comment otherwise.

我认为最近的一次更新取消了从r中读取存储在Dropbox上的数据文件的功能,我将去寻找确认,并删除我的评论。

Source: Ran into the same issue myself a couple of months ago

来源:几个月前我自己也遇到过同样的问题。

UPDATE: Confirmation of dropped support within the github package https://github.com/christophergandrud/repmis/commit/f85469f38c6f4e4a5735ecc888b4263b969d4e22

更新:确认github包中丢失的支持,https://github.com/christophergandrud/repmis/commit/f85469f38c6f4a5735ecc888b4263b969d4e22

#1


1  

I think a recent update removed the ability to read data files stored on Dropbox from within R. I will go look for confirmation, and delete my comment otherwise.

我认为最近的一次更新取消了从r中读取存储在Dropbox上的数据文件的功能,我将去寻找确认,并删除我的评论。

Source: Ran into the same issue myself a couple of months ago

来源:几个月前我自己也遇到过同样的问题。

UPDATE: Confirmation of dropped support within the github package https://github.com/christophergandrud/repmis/commit/f85469f38c6f4e4a5735ecc888b4263b969d4e22

更新:确认github包中丢失的支持,https://github.com/christophergandrud/repmis/commit/f85469f38c6f4a5735ecc888b4263b969d4e22