ajdamico / lodown

locally download and prepare publicly-available microdata
GNU General Public License v3.0
97 stars 47 forks source link

Get PME running #159

Closed simondgreenhill closed 4 years ago

simondgreenhill commented 4 years ago

This is one of two pull requests I'm making to make the lodown package run for the Pesquisa Mensal de Emprego (PME). Changes are as follows:

  1. Switch from using httr to using unzip_verify as the filesize_fun argument in calls to cachaca() in pme.R. When using httr, I was encountering errors, which I believe is related to the httr packages' lack of support for FTP.
  2. Allow the SAS parser in read_SAScii to accept an encoding argument, which will convert SAS code to an encoding of the user's choice. This allows the SAS parser to parse SAS code that is written in encodings other than UTF-8 (the SAS code that is provided with PME's documentation is not in UTF-8).

Please note that I'm not an expert on the technical details of this stuff and made these changes to get lodown running for me in as short a time as possible. I hope these changes will be helpful to other users too, but they may well have limitations I haven't explored.

Edit: see the second pull request here.