This function retrieves multiple NCM (Nomenclatura Comum do Mercosul) datasets from the comexstat
package,
merges them into a single data frame, and converts all columns to character format.
Usage
ncms(files = c("ncm", "ncm_cgce", "ncm_cuci", "ncm_isic", "ncm_unidade"))
Value
A merged data frame containing all specified NCM datasets, with all columns converted to character format.
Details
This function streamlines the process of working with multiple NCM datasets from the comexstat
package. It performs the following steps:
Retrieval: Retrieves the specified NCM datasets using the
comex
function.Merging: Combines all retrieved datasets into a single data frame using left joins.
Format Conversion: Converts all columns in the merged data frame to character format for consistent data manipulation.
The function suppresses messages and warnings during the retrieval and merging steps to provide a cleaner output.
Examples
if (FALSE) { # \dontrun{
# Merge and format default NCM datasets
merged_ncms <- ncms()
# Merge specific NCM datasets (e.g., only 'ncm' and 'ncm_cuci')
merged_ncms <- ncms(files = c('ncm', 'ncm_cuci'))
} # }