loadcomext1product: Load all archive and recent Comext data for one product

Description Usage Value Examples

View source: R/cleancomext.R

Description

The function will use the database connector provided as RMariaDBcon argument. It will load the product from an archive table and a recent table. The function will combine the archive table and the recent table in one dataframe and will return a dataframe.

Usage

1
2
loadcomext1product(RMariaDBcon, productanalysed,
  monthlytable = "raw_comext_monthly", tableunit = "vld_comext_unit")

Value

a data frame containing Comext trade flows for the given product

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run:  # Clean product and country codes
# Connect to the database
con <- RMariaDB::dbConnect(RMariaDB::MariaDB(), dbname = "tradeflows")
# Load data for product 44079910
dtf <- loadcomext1product(con,
                          productanalysed = "44071091",
                          tablearchive = "raw_comext_monthly_2016S1",
                          rawtable = "raw_comext_monthly_201709")
head(dtf)
unique(dtf$year)
# Disconnect from the database
RMariaDB::dbDisconnect(con)

## End(Not run)

EuropeanForestInstitute/tradeflows documentation built on Oct. 7, 2019, 10:57 a.m.