I'm using XBRL package to import XBRL data from the SEC EDGAR website, and whenever I use xbrlDoAll function, it is unable to read the url, even though I provided the valid one. For example, to replicate this error, use the following:
library(XBRL)
inst <- "https://www.sec.gov/Archives/edgar/data/320193/000032019318000145/aapl-20180929.xml"
xbrl.vars <- xbrlDoAll(inst)
This is the error I get:
Error in fileFromCache(file) : Error in download.file(file, cached.file, quiet = !verbose) : cannot open URL 'https://www.sec.gov/Archives/edgar/data/320193/000032019318000145/https://xbrl.sec.gov/dei/2018/dei-2018-01-31.xsd'
As you can see, the URL cannot be opened because for some reason it adds another https:// in the middle of the link to get the file.
Which makes it an invalid url. I tried to manually download the file to the cache folder but the issue still persists. How can I edit it so it can properly read and download the content from the links? Thank you.