0

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.

https://www.sec.gov/Archives/edgar/data/320193/000032019318000145/https://xbrl.sec.gov/dei/2018/dei-2018-01-31.xsd

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.

Mons
  • 13
  • 4

2 Answers2

0

This looks like a bug.

Just as a wild guess I would try to use a slightly modified url: http://www.sec.gov/Archives/edgar/data/320193/000032019318000145/aapl-20180929.xml.

Using http instead of https.

Dennis Münkle
  • 5,036
  • 1
  • 19
  • 18
0

This is a bug as the package has not been maintained very well. What you need to do is go straight to this website: https://xbrl.sec.gov/dei/2018/dei-2018-01-31.xsd and then save it directly into your xbrl.Cache folder (or whichever folder is serving as your cache).

bdavis562002
  • 101
  • 3