Skip to contents

The 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_config from config_scaleup().

base_financials

A data frame of raw firm-level financials, as described in variable_dictionary and vignette("input-data"). Must contain idf, 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_RAW in variable_dictionary), with columns idf, idp, year. If NULL (the default), no multiplant indicator is produced.

exchange_rates

Optional data frame with columns year, country, rate, used for the non-euro countries in country_patches$non_euro. NULL (the default) uses the package's exchange_rates.

tl3_typology

Optional data frame with columns region_3d, typology_access_cities (and classification, to select config$tl_classification), used when base_financials has a region_3d column. 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 of base_financials, as stored in its .dta file. run_scaleup_pipeline() reads it from the file header. A float (or byte/int) variable rescaled to EUR thousand is rounded to single precision, as the file stores it. NULL (the default) treats every column as double.

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().