Skip to contents

This function reads a specified Comexstat (Brazilian trade statistics) dataset from a local CSV file, cleans the column names, and applies standardized column renaming.

Usage

comex(table, dir = comexr:::cdircomex, extension = ".csv", ...)

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 as col_types, na, etc.

Value

A tibble (data frame) containing the specified Comexstat data with standardized column names.

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')

} # }