Error reading an xlsx file from Dropbox using the R package 'repmis'

好久不见. 提交于 2019-12-11 05:06:06

问题


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:

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:


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.

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



来源:https://stackoverflow.com/questions/39339492/error-reading-an-xlsx-file-from-dropbox-using-the-r-package-repmis

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!