Hello everybody.
I need to read the files with a url address in a certain period of years, however they have changed the pattern in the filenames over the years, so before downloading I was trying to make a change to the read and unzip using:
if (stringr::str_detect(url, "2013-2t")) {
string_subset <- "2Q2013"
} else {
string_subset <- stringr::str_sub(url, start = 73, end = 78)
}
But it's not working.
Contnuo tendo o erro:
Error in download.file(url = url, destfile = temp, method = "auto", quiet = TRUE) :
cannot open URL 'http://ftp.dadosabertos.ans.gov.br/FTP/PDA/demonstracoes_contabeis/2013/2T2013.zip'