Downloading a file from the internet using R is easy and has been addressed previously.
My question regards how to get past a popup message that seems to prevent my download from executing. Specifically,
download.file(url = "https://www.chicagofed.org/applications/bhc_data/bhcdata_index.cfm?DYR=2012&DQIR=4", destfile = "data/test.zip")
gives me a little file of garbage instead of the desired 18 megabyte file that you would get if you went to the website and entered the year 2012
and the quarter 4
manually. I suspect that the issue is that, as can be seen when you do it manually, a popup window interrupts the download process, asking whether to save the file or open it. Is there any way to get past the popup automatically (i.e., via download.file
)?