As per my post in SO, fread cannot import and unzip the following URL:
dt <- fread("https://www.portaltransparencia.gov.br/download-de-dados/despesas-execucao/202001")
The work around was to read the url imposing mode = "wb" :
download.file("https://www.portaltransparencia.gov.br/download-de-dados/despesas-execucao/202001" , destfile = "test_file.zip" , mode = "wb")
unzip("test_file.zip", exdir = "."
It would be nice if fread provide an option to deal with cases like this.
As per my post in SO, fread cannot import and unzip the following URL:
dt <- fread("https://www.portaltransparencia.gov.br/download-de-dados/despesas-execucao/202001")The work around was to read the url imposing mode = "wb" :
download.file("https://www.portaltransparencia.gov.br/download-de-dados/despesas-execucao/202001" , destfile = "test_file.zip" , mode = "wb")unzip("test_file.zip", exdir = "."It would be nice if fread provide an option to deal with cases like this.