View source: R/import_balance_sheets.R
| import_balance_sheets | R Documentation |
Imports CSV files from BCB by detecting the header line that contains the tokens "DOCUMENTO", "CONTA", and "SALDO" (case-insensitive). Automatically renames columns and removes unnecessary fields.
This function is intended for internal use by tidy_balance_sheets()
import_balance_sheets(file_paths)
file_paths |
Character vector of file paths to import. |
For each file:
Reads line-by-line searching for a header containing DOCUMENTO, CONTA, and SALDO
Auto-detects delimiter (;, ,, or whitespace)
Imports using data.table::fread for speed and robustness
Renames: DATA_BASE/DATA BASE/#DATA_BASE -> DATA, NOME INSTITUICAO -> nome_instituicao
Removes columns: ATRIBUTO, NOME CONTA, AGENCIA, COD_CONGL, NOME_CONGL, TAXONOMIA, NOME_CONTA
Returns combined data.frame from all files
A data.frame combining all imported files, or NULL if no valid files.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.