Title: | Fetch Data from Plataforma +Brasil (SICONV) |
Version: | 0.0.1 |
Description: | Fetch data on targeted public investments from Plataforma +Brasil (SICONV) http://plataformamaisbrasil.gov.br/, the responsible system for requests, execution, and monitoring of federal discretionary transfers in Brazil. |
License: | GPL (≥ 3) |
Encoding: | UTF-8 |
URL: | https://github.com/meirelesff/siconvr, https://fmeireles.com/siconvr/ |
BugReports: | https://github.com/meirelesff/siconvr/issues |
RoxygenNote: | 7.1.1 |
Imports: | data.table, httr, magrittr, tibble, dplyr, cli |
Suggests: | testthat (≥ 3.0.0), covr |
Config/testthat/edition: | 3 |
NeedsCompilation: | no |
Packaged: | 2021-05-17 14:03:31 UTC; fernando |
Author: | Fernando Meireles |
Maintainer: | Fernando Meireles <fmeireles@ufmg.br> |
Repository: | CRAN |
Date/Publication: | 2021-05-18 08:00:02 UTC |
siconvr is a package designed to extract and clean data on federal targeted transfers in Brazil from SICONV (Sistema de Gestao de Convenios e Contratos de Repasse, in Portuguese).
Description
siconvr
has one main function: get_siconv()
Details
Under the hoods, this functions takes care of building the URLs for the
desired files; downloads, stores, and unzip files' contents; and read
the retrieved datasets as fast as possible using data.tables
' fread()
.
Users can select a wide range of datasets to download: data on proposals submited to the Brazilian Federal Government requesting local investments; details on these proposals; data on accepted projects, their evaluations; and the total amounts transfered.
To check the function's documentation page, run ?get_siconv
.
Author(s)
Maintainer: Fernando Meireles fmeireles@ufmg.br (ORCID)
Authors:
Marcus Vinícius de Sá Torres marcus.torres@ufpe.br (ORCID)
See Also
Useful links:
Report bugs at https://github.com/meirelesff/siconvr/issues
Pipe operator
Description
See magrittr::%>%
for details.
Usage
lhs %>% rhs
Arguments
lhs |
A value or the magrittr placeholder. |
rhs |
A function call using the magrittr semantics. |
Value
The result of calling rhs(lhs)
.
Fetch cleaned data from Plataforma +Brasil
Description
get_siconv()
is the package's workhorse. It downloads, cleans, and
returns one of the several datasets maintained by Plataforma +Brasil on federal
targeted transfers in Brazil. Under the hoods, the function handles GET requests,
downloads and stores intermediary files, and reads as fast as possible the data
to a tibble
format convenient for use in analysis.
Usage
get_siconv(dataset = NULL, encoding = "UTF-8", cache = TRUE, verbose = TRUE)
Arguments
dataset |
A
When not specified, |
encoding |
Encoding used to read raw files. Defaults to "UTF-8", but users might need to change this option to other valid options (e.g., "latin1") if data are returned with uncommon characters. |
cache |
Should the function maintain a local copy of the data? To save
both time and SICONV's server resources, this defaults to |
verbose |
Should the function display messages and progress bar? Defaults
to |
Value
A tibble contantaining the requested data as defined in the
dataset
argument. Use the show_schema
function to get detailed information
on available variables and information.
Note
get_siconv()
needs an internet connection to download data in case it
does not found a cache folder with raw data from a previous request. Be aware that instability
in the Plataforma +Brasil server might produce error messagens, in which case users
should try waiting before rerunning their requests.
Examples
## Not run: df <- get_siconv(dataset = "propostas")
Access Plataforma +Brasil's documentation
Description
show_schema()
downloads, unzips, and show in a web browser Plataforma +Brasil's
full database documentation, including its schema and other usefull information.
Docs are downloaded to a folder in the working directory.
Usage
show_schema(verbose = TRUE, browser = TRUE)
Arguments
verbose |
Should the function display messages and progress bar? Defaults
to |
browser |
Should the function open a web browser to display the docs?
Defaults to |
Value
show_schema()
is most usefull for its side effect of downloading,
when needed, and opening Plataforma +Brasil's documentation, but is also silently
returns a string containing the path to the docs' index file.
Note
show_schema()
needs an internet connection to download data in case it
does not found a cache folder with the docs from a previous request. Be aware that instability
in the Plataforma +Brasil server might produce error messagens, in which case users
should try waiting before rerunning the function.
Examples
## Not run: show_schema()