| Title: | Consolidates Information from the Federal Government Payment Card | 
| Version: | 0.0.1.0 | 
| Maintainer: | Dalson Figueiredo <dalson.figueiredofo@ufpe.br> | 
| Description: | Provides access to consolidated information from the Brazilian Federal Government Payment Card. Includes functions to retrieve, clean, and organize data directly from the Transparency Portal https://portaldatransparencia.gov.br/download-de-dados/cpgf/ and a curated dataset hosted on the Open Science Framework https://osf.io/z2mxc/. Useful for public spending analysis, transparency research, and reproducible workflows in auditing or investigative journalism. | 
| License: | GPL-3 | 
| Encoding: | UTF-8 | 
| BugReports: | https://github.com/datafobia/cpgf/issues | 
| RoxygenNote: | 7.3.2 | 
| Depends: | R (≥ 3.5) | 
| Imports: | data.table, stringr, osfr, lubridate, deflateBR, curl | 
| NeedsCompilation: | no | 
| Packaged: | 2025-06-17 15:18:42 UTC; denis | 
| Author: | Dalson Figueiredo | 
| Repository: | CRAN | 
| Date/Publication: | 2025-06-18 12:00:02 UTC | 
Database the Federal Government Payment Card CPGF - Brazil (2013 up to May 2025)
Description
The Federal Government Payment Card (CPGF) is a payment instrument used by the government that operates similarly to a regular credit card, but within specific limits and regulations. The government uses the CPGF to cover its own expenses, provided they qualify as advances of funds (suprimento de fundos).
Usage
cpgf_data()
Value
cpgf_data() returns a data.frame with the following variables:
- codigo_orgao_superior
- Code corresponding to the Higher Body of the managing authority on behalf of which the government payment card was formally issued. 
- nome_orgao_superior
- Name of the Higher Body of the managing unit on behalf of which the payment card was issued. 
- codigo_orgao
- Code of the Subordinate Body of the managing unit on behalf of which the payment card was issued. 
- nome_orgao
- Name of the Subordinate Body of the managing unit on behalf of which the payment card was issued. 
- codigo_unidade_gestora
- Code of the Managing Unit on behalf of which the payment card was issued. 
- nome_unidade_gestora
- Name of the Managing Unit. 
- ano_extrato
- Year of the transaction statement. 
- mes_extrato
- Month of the transaction statement. 
- cpf_portador
- CPF of the cardholder who performed the transaction. 
- nome_portador
- Name of the cardholder who performed the transaction. 
- cnpj_ou_cpf_favorecido
- CNPJ of the establishment or CPF of the individual who received the payment. 
- nome_favorecido
- Name of the establishment or individual who received the payment. 
- transacao
- Transaction carried out by the cardholder with the affiliated merchant or contracted party, using the Federal Government Payment Card (CPGF). 
- data_transacao
- Date on which the transaction was carried out. Note: when the beneficiary is classified as confidential, there is no transaction date; in these cases, the lowest date on the reference statement was assigned. 
- valor_transacao
- Amount of the transaction carried out with the card, in Brazilian reais (BRL) as character. 
- data_date
- Date on which the transaction was carried out. Note: when the beneficiary is classified as confidential, there is no transaction date; in these cases, the lowest date on the reference statement was assigned. 
- ano_mes
- Year and month on which the transaction was carried out. 
- valor_transacao2
- Amount of the transaction carried out with the card, in Brazilian reais (BRL) as numeric. 
- valor_transacao_deflacionado
- Total deflated transaction value to facilitate comparison, in Brasilian reais. Deflated until April 2025 (because transactions are up to the previous month of the statement, which here goes until May), using the IPCA index. 
Examples
# Download data on the Federal Government Payment Card (CPGF)
if(interactive() && curl::has_internet()) {
   cpgf <- cpgf_data()
 }
Download the database the Federal Government Payment Card CPGF - Brazil
Description
Download the database the Federal Government Payment Card CPGF - Brazil
Usage
get_cpgf(year, month, deflate = NULL, index_deflate = "ipca")
Arguments
| year | Valid options are 2013 to corrent. | 
| month | Valid options are 01 to 12. | 
| deflate | By default, it is NULL, but when a value is provided in the format month/year (mm/yyyy), the corrected value is calculated using the selected inflation index and create variable "valor_transacao_deflacionado", which is IPCA by default. For more information, see the deflateBR package. | 
| index_deflate | If deflate is not NULL, IPCA is used by default. For more information, see the deflateBR package. | 
Value
(get_cpgf) returns a data.frame
Examples
# Download data on the Federal Government Payment Card (CPGF)
if(interactive() && curl::has_internet()) {
  cartao <- get_cpgf(2023, 12)
  }