Compute year-on-year and cumulative trade growth for a bilateral flow.
Usage
ct_growth(
reporter,
partner = "0",
commodity = "TOTAL",
flow = "X",
years = NULL,
cache = TRUE
)Examples
# \donttest{
op <- options(comtrade.cache_dir = tempdir())
g <- tryCatch(ct_growth("GBR", flow = "X", years = 2018:2023),
error = function(e) NULL)
#> ℹ No API key set. Using preview endpoint (500 records max, no descriptions).
#> ℹ For full access (100k records, descriptions), get a free key at
#> <https://comtradedeveloper.un.org/>
#> ℹ Then run: `ct_set_key("your-key")`
#> Waiting 2s for retry backoff ■■■■■■■■■■■■■■■
#> Waiting 2s for retry backoff ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
if (!is.null(g)) head(g)
options(op)
# }