danicat / read.dbc

An R package for reading data in the DBC (compressed DBF) format used by DATASUS.
69 stars 29 forks source link

error decompressing file: 2 #12

Closed guidcarvalho closed 1 year ago

guidcarvalho commented 1 year ago

Dani,

I was able to download the CNES data from the ftp, but when I try to read it in R it appears to have something wrong. When I try to use the funciont read.dbc the following error shows up: "Error in dbc2dbf(file, out) : error decompressing file: 2". Do you have any idea of why this error shows up?

Thanks, Guilherme Carvalho

danicat commented 1 year ago

This usually happens when your downloaded file is corrupted. Make sure you are downloading it in binary mode and try again.

guidcarvalho commented 1 year ago

Thank you for your help. I was able to solve the problem adding mode = "wb" in the download.file function.