findLinks: Find the specific linkages in the WIOD

Description Usage Arguments Value

Description

Find the specific linkages in the WIOD

Usage

1
2
3
findLinks(partners, flat_wiod, start_countries, start_sectors,
  ListOfselectionFuns, by = if (partners == "suppliers") c("ImpCountry",
  "ImpSectorNr") else c("ExpCountry", "ExpSectorNr"))

Arguments

partners

String: either "suppliers" or "users".

flat_wiod

"Flat" WIOD data.table returned by flatWIOD, possibly modified by a user (e.g. with added columns to be used through by or with some irrelevant linkages/rows removed). None of the basic 5 columns returned by flatWIOD must be removed.

start_countries

Character vector: a three-letter ISO country code, as in the WIOD file (character vector), see also countries, of the countries whose top partners are to be found in the first round.

start_sectors

Numeric vector: WIOD numeric codes (integers) for industries and final use sectors, see also sectors, of the sectors whose top partners are to be found in the first round.

ListOfselectionFuns

List (with at least 1 element) of functions, where each function takes flat_wiod as an argument and returns a logical vector: which partners should be selected at each round.

by

Optional character vector: the names of the flat_wiod's columns containing the groupings by which the partners will be selected. Default: none i.e. empty string (""). Default: importing country and sector (when extracting suppliers) or exporting country and sector (when extracting customers).

Value

A data.table (with added S3 class 'SelectedLinksDT' with a corresponding plotLinks implementation) with the same columns as in flat_wiod (but ordered differently), with only those rows that represent the top direct and (possibly) indirect linkages.

This function extracts the first-round (direct) and further (indirect) backward or forward linkages (i.e. suppliers of suppliers of suppliers etc. or customers of customers of customers etc.), based on the functions in ListOfselectionFuns which take flat_wiod and for each combination of the dimensions specified in by return a logical (Boolean) vector which determines if a given partner is selected or not.

The direction of the flows (backward or forward) is determined by the string argument partners which must be either "suppliers" or "users".

The number of rounds is determined by the length of ListOfselectionFuns i.e. if this vector contains e.g. two functions, findLinks will extract the direct linkages and one layer of indirect linkages. The functions in the breadth_vec vector determine which partners selected at round (for each combination/grouping as described above).

The starting point of the search for top partners is determined by the arguments start_countries and start_sectors – the partners of those countries and sectors will be searched in the first round.


alekrutkowski/wiod.diagrammer documentation built on May 20, 2019, 8:47 a.m.