Error while importing xlsx file from url using the xlsx package in R




I am using the following code to download an xlsx file from a website:

fileUrl <- ""
download.file(fileUrl1,destfile = "./getting_cleaning/cameras.xlsx")

After this when I am trying to read the file using

camera_data <- read.xlsx("./getting_cleaning/cameras.xlsx",sheetIndex = 1,header = TRUE)

I am getting the error:

Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl,  : invalid entry size (expected 500 but got 504 bytes)

Can someone please help me with this!!


why not download the file and read it using this


Thanks a lot @ajay_ohri.
It helped!! :smile:


@shuvayan, the variable names seem to differ fileUrl vs. fileUrl1. Or was that a typo just in this post?

@ajay_ohri, perhaps readxl is so recent that they haven’t yet included it in the standard MOOC curriculum. :wink:


Hello @anon,

Ya it was a typo :stuck_out_tongue:
You are also right about the RECENTNESS of the readxl package :smile: