Error reading a URL

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'

Im search the url but the site dont exist

You must verify well the pattern of changes in the links of each page

Yes, it does not exist, the correct one is http://ftp.dadosabertos.ans.gov.br/FTP/PDA/demonstracoes_contabeis/2013/2013-2t
but this one the program won't read, so I was trying to change it so that it read

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.