potr_download: Download files of the 'Portal da Transparencia'

Description Usage Arguments Details Examples

View source: R/potr_download.R


This function can be used to download a dataset from the 'Portal da Transparencia' of Brazil - http://www.portaltransparencia.gov.br.


potr_download(opendata, reference, destfile, filename, download.file.mode,



A character or numeric that indicates a dataset selected for download. See valid options in 'Details'.


A character string or numeric input thats indicates a date reference to download. Valid date which may be 'yyyy' for year, 'mm' for month, 'dd' day or the join of these (yyyymm, yyyymmdd). See valid options in 'Details'.


A character string with the name where the downloaded file is saved. If missing, the file will be saved to the current directory.


File name to dataset. By default, the file name is the title of 'opendata' with the 'reference' and '.zip' extension.


The mode with which to write the file. If download.file.mode is not found and the operating system is windows, it will use the "wb".


Others arguments of the download.file function.


The function downloads files available in the repository of transparency portal - website of the federal government of Brazil on public transparency, with budgetary data and government management. The data disclosed in the Portal come from various sources of government information. See http://www.portaltransparencia.gov.br/.

The function arguments are specifications about the data set to be downloaded. 'opendata' is related to the content of the data, 'reference' to the date of availability of the file in the portal, 'destfile' to the location to be saved and 'filename' is the name of the file to be saved. Other '...' arguments are related to the download.file function of the 'utils' package.

It is suggested that the values for '...' be reported only if the default setting does not work. See download.file for more information about these arguments and proxy settings.

Valid options for 'opendata' and 'reference' arguments:

id description opendata reference
1 Bolsa familia pagamentos bolsa-familia-pagamentos yyyymm
2 Bolsa familia saques bolsa-familia-saques yyyymm
3 Erradicacao do trabalho infantil PETI peti yyyymm
4 Garantia safra garantia-safra yyyymm
5 Seguro defeso pescador artesanal seguro-defeso yyyymm
6 Cartao pagamento compras centralizadas cpcc yyyymm
7 Cartao pagamento da defesa civil CPDC cpdc yyyymm
8 Cartao pagamento governo federal CPGF cpgf yyyymm
9 Convenios convenios yyyymmdd
10 Documentos empenho, liquidacao e pagamento despesas yyyymmdd
11 Execucao da despesa despesas-execucao yyyymm
12 Recursos transferidos transferencias yyyymm
13 Imoveis funcionais imoveis-funcionais_md yyyymmdd
14 Imoveis funcionais imoveis-funcionais_mre yyyymmdd
15 Imoveis funcionais imoveis-funcionais_pr yyyymmdd
16 Imoveis funcionais imoveis-funcionais_spu yyyymmdd
17 Contratacoes compras yyyymm
18 Licitacoes licitacoes yyyymm
19 Orcamento da despesa orcamento-despesa yyyy
20 Execucao da receita receitas yyyy
21 Empresas inidoneas e suspensas ceis yyyymmdd
22 Empresas punidas cnep yyyymmdd
23 Entidades sem fins lucrativos impedidas cepim yyyymmdd
24 Cadastro de expulsoes da administracao federal CEAF ceaf yyyymmdd
25 Dirigentes de empresas dirigentes yyyymm
26 Servidores civis do executivo federal servidores_civis yyyymm
27 Servidores militares do executivo federal servidores_militares yyyymm
28 Viagens a servico viagens yyyy


potr_download(opendata = 19, reference = 2019)
potr_download(opendata = 19, reference = 2019, destfile = "~/")
potr_download(opendata = 19, reference = 2019, destfile = "~/", filename = "orcamento")
potr_download(opendata = "19", reference = "2019")
potr_download(opendata = "19", reference = "2019", destfile = "~/")
potr_download(opendata = "19", reference = "2019", destfile = "~/", filename = "orcamento")
potr_download(opendata = "orcamento-despesa", reference = "2019")
potr_download(opendata = "orcamento-despesa", reference = 2019, destfile = "~/")
potr_download(opendata = "orcamento-despesa", reference = 2019, destfile = "~/", filename = "orcamento")

pompylio/portransp documentation built on Aug. 2, 2019, 8:42 a.m.