Issue with loading file from URL, only where located in certain places

48 Views Asked by At

I have an issue with loading data from a Dropbox folder, and have absolutely no idea why. Several posts suggest that the issue can be solved by closing the file before loading it, but it's obviously not it in my case: it works when the file is located in my personal Dropbox, but fails when the exact same file is located in my pro Dropbox...

library("openxlsx")
works <- read.xlsx("
https://www.dropbox.com/scl/fi/9lcwo7pj334oo83mraz5a/IOTC-DATASETS-2024-01-29-SF-SKJ-1982-2022.xlsx?rlkey=s8vhjrayk3tw1tju3jgw29g90&dl=1", sheet = "DATA")
fails <- read.xlsx("
https://www.dropbox.com/scl/fi/qwsdkl1cwjmmoq14grb6u/IOTC-DATASETS-2024-01-29-SF-SKJ-1982-2022.xlsx?rlkey=8ufrizdorbxoyreaslhgjhuu0&dl=1", sheet = "DATA")

Error says:

Error in file(con, "r") : invalid 'description' argument
6.
file(con, "r")
5.
readLines(x, warn = FALSE, encoding = "UTF-8")
4.
readUTF8(workbookRelsXML)
3.
paste(readUTF8(workbookRelsXML), collapse = "")
2.
read.xlsx.default("https://www.dropbox.com/scl/fi/7x3vj88zkbahkkfrfszj1/IOTC-DATASETS-2024-01-29-SF-SKJ-1982-2022.xlsx?rlkey=8h13zak9nkj9c2z6p8vyx3tm6&dl=1",
sheet = "DATA")
1.
read.xlsx("https://www.dropbox.com/scl/fi/7x3vj88zkbahkkfrfszj1/IOTC-DATASETS-2024-01-29-SF-SKJ-1982-2022.xlsx?rlkey=8h13zak9nkj9c2z6p8vyx3tm6&dl=1",
sheet = "DATA")

Any idea why?

Thanks a lot!

0

There are 0 best solutions below