While executing the following command got this error:
> dat <- colindex="colIndex," endrow="23," file="NGAP.xlsx" header="TRUE)</b" read.xlsx="" sheetindex="1," startrow="18,">->
Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, :
java.util.zip.ZipException: invalid code -- missing end-of-block
Got this problem with a file downloaded from the internet using R command line, for an online course. Actually found that apparently the download mode needs to be set properly as write-binary (wb) since xlsx is basically a binary file (zip).
In that case we have to download again
> download.file (url=URL3, destfile="NGAP.xlsx", mode='wb')
> dat <- colindex="colIndex," endrow="23," file="NGAP.xlsx" header="TRUE)</b" read.xlsx="" sheetindex="1," startrow="18,">->
It worked fine.
> dat <- colindex="colIndex," endrow="23," file="NGAP.xlsx" header="TRUE)</b" read.xlsx="" sheetindex="1," startrow="18,">->
Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, :
java.util.zip.ZipException: invalid code -- missing end-of-block
Got this problem with a file downloaded from the internet using R command line, for an online course. Actually found that apparently the download mode needs to be set properly as write-binary (wb) since xlsx is basically a binary file (zip).
In that case we have to download again
> download.file (url=URL3, destfile="NGAP.xlsx", mode='wb')
> dat <- colindex="colIndex," endrow="23," file="NGAP.xlsx" header="TRUE)</b" read.xlsx="" sheetindex="1," startrow="18,">->
It worked fine.
Comments