This function reads a specified Comexstat (Brazilian trade statistics) dataset from a local CSV file, cleans the column names, and applies standardized column renaming.
Arguments
- table
A character string specifying the name of the Comexstat table to read.
- dir
The directory containing the Comexstat data file (defaults to
comexr:::cdircomex
).- extension
The file extension of the Comexstat data file (defaults to '.csv').
- ...
Additional arguments passed to
readr::read_csv2
, such ascol_types
,na
, etc.
Examples
if (FALSE) { # \dontrun{
# Read the 'ncm' table from the default directory
ncm_data <- comex('ncm')
# Read the 'ncm_cgce' table from a specific directory ('my_data')
ncm_cgce_data <- comex('ncm_cgce', dir = 'my_data')
# Read a table with a different extension (e.g., .txt)
other_data <- comex('other_table', extension = '.txt')
} # }