Build the trade package's firm-year panel (trade_accounts_indicators)
Source: R/trade-panel.R
build_trade_accounts_indicators.RdThe panel of build_accounts_indicators() with the firm-year
trade panel (build_trade_panel()) merged in, and exporter/importer flags,
first-time exporters (y4_exporter), heavy/light exporting turnover
scalers (HGX10/20, HGNX10/20), sector_exporter and digit_sect
added. Regions are not aggregated and there is no reg_techgrad.
Usage
build_trade_accounts_indicators(
config,
base_financials,
trade_raw,
plants_raw = NULL,
exchange_rates = NULL,
tl3_typology = NULL,
storage_types = NULL,
trade_storage_types = NULL
)Arguments
- config
A
scaleup_configfromconfig_scaleup().- base_financials
A data frame of raw firm-level financials, as described in variable_dictionary and
vignette("input-data"). Must containidf, year, sector_1d, sector_2d, sector_3d, employment, turnover, region_2d; every other column is optional and used only if present.- trade_raw
The transaction-level trade data (see
build_trade_panel()).- plants_raw
Optional data frame of establishment-level data (
plants_RAWin variable_dictionary), with columnsidf, idp, year. IfNULL(the default), nomultiplantindicator is produced.- exchange_rates
Optional data frame with columns
year, country, rate, used for the non-euro countries incountry_patches$non_euro.NULL(the default) uses the package's exchange_rates.- tl3_typology
Optional data frame with columns
region_3d, typology_access_cities(andclassification, to selectconfig$tl_classification), used whenbase_financialshas aregion_3dcolumn.NULL(the default) uses the package's tl3_typology.- storage_types
Optional named character vector giving the storage type (
"byte","int","long","float","double") of the columns ofbase_financials, as stored in its.dtafile.run_scaleup_pipeline()reads it from the file header. Afloat(orbyte/int) variable rescaled to EUR thousand is rounded to single precision, as the file stores it.NULL(the default) treats every column asdouble.- trade_storage_types
Optional storage types of
trade_raw.
Value
A data frame, one row per (idf, year) of base_financials, ready
for compute_trade_characteristics().