gta_data_slicer: This function allows you to extract a tailored subset of the...

View source: R/gta data slicer.R

gta_data_slicerR Documentation

This function allows you to extract a tailored subset of the GTA database.

Description

Make use of the many variables captured in the taxonomy of the Global Trade Alert and tailor the data to your needs. This function returns a list of 2 data frames. The first, master, contains the subset of GTA data you requested. The second, parameter.choices, lists all implicit or exlicited choices that led to the subset.

Usage

gta_data_slicer(
  data.path = "data/master_plus.Rdata",
  gta.evaluation = NULL,
  affected.flows = NULL,
  implementing.country = NULL,
  keep.implementer = TRUE,
  affected.country = NULL,
  keep.affected = NULL,
  incl.affected.strictness = "ONEPLUS",
  keep.others = TRUE,
  nr.affected = c(0, 999),
  nr.affected.incl = "ALL",
  announcement.period = NULL,
  implementation.period = NULL,
  keep.implementation.na = NULL,
  revocation.period = NULL,
  keep.revocation.na = TRUE,
  submission.period = NULL,
  in.force.on.date = Sys.Date(),
  keep.in.force.on.date = "any",
  intervention.types = NULL,
  keep.type = NULL,
  mast.chapters = NULL,
  keep.mast = NULL,
  implementation.level = NULL,
  keep.level = NULL,
  eligible.firms = NULL,
  keep.firms = NULL,
  cpc.sectors = NULL,
  keep.cpc = NULL,
  hs.codes = NULL,
  keep.hs = NULL,
  intervention.ids = NULL,
  keep.interventions = NULL,
  lag.adjustment = NULL,
  reporting.period = NULL,
  add.unpublished = F,
  df.name = "master.sliced",
  pc.name = "parameter.choice.slicer",
  xlsx = FALSE,
  output.path = NULL
)

Arguments

data.path

Specifies where the GTA data file is located (Default: 'data/master_plus.Rdata'). Set to 'online' to download the latest copy.

gta.evaluation

Specify what GTA evaluations to include. Default is 'any'. Permissible values are 'red', 'amber', 'green' or combinations thereof.

affected.flows

Specify the direction of the trade flow that is affected. The point of view is from the implementing country. Default is 'any'. Permissible values are 'inward', 'outward', 'outward subsidy' or combinations thereof.

implementing.country

Specify the implementing countries for your analysis. Default is 'any'. Permissible values are country names or UN codes.

keep.implementer

Specify whether to focus on ('TRUE') or exclude ('FALSE') interventions with the stated implementing country.

affected.country

Specify the affected countries for your analysis. Default is 'any'. Permissible values are country names or UN codes.

keep.affected

Specify whether to focus on ('TRUE') or exclude ('FALSE') interventions with the stated affected country.

incl.affected.strictness

Specify whether to include interventions that affect only one of the selected affected jurisdictions ('ONE'), at least one of the selected affected jurisdictions ('ONEPLUS') or all of the selected affected jurisdictions ('ALL'). Default is 'ONEPLUS'.

keep.others

Specify whether to keep the data for the other jurisdictions that happen to be affected alongside those you specified (T/F). Default is 'TRUE'.

nr.affected

Specify the range for the number of importers affected by an intervention. Default is any number i.e. c(0,999).

nr.affected.incl

Specify whether in the number of importers affected by an intervention is calculated based only on the selected importers are included ('SELECTED'), only on the unselected importers ('UNSELECTED') or based on both ('ALL'). Default is 'ALL'.

announcement.period

Specify a period in which the announcements for your analysis have been made. Default is 'any'. Provide vectors c(after.date, before.date) in R's date format. Also, specify c(after.date, NA) to focus on interventions announced since 'after.date'.

implementation.period

Specify a period in which the interventions for your analysis have been implemented. Default is 'any' (incl. not implemented to date). Provide vectors c(after.date, before.date) in R's date format. Also, specify c(after.date, NA) to focus on interventions implemented since 'after.date'.

keep.implementation.na

Specify whether to keep ('TRUE') or remove ('FALSE') interventions with missing implementation.date.

revocation.period

Specify a period in which the interventions for your analysis have been revoked. Default is 'any' (incl. not revoked). Provide vectors c(after.date, before.date) in R's date format. Also, specify c(after.date, NA) to focus on interventions revoked since 'after.date'.

keep.revocation.na

Specify whether to keep ('TRUE') or remove ('FALSE') interventions with missing revocation.date.

submission.period

Specify a period in which the interventions for your analysis have been submitted. Default is 'any'. Provide vectors c(after.date, before.date) in R's date format. Also, specify c(after.date, NA) to focus on interventions revoked since 'after.date'.

in.force.on.date

Specify the cutoff date to control for in force interventions. Default is the current date (Sys.Date).

keep.in.force.on.date

Specify whether you want to focus on interventions in force on the specified date ('Yes') or no longer in force on the specified date ('No'). Default is 'any' i.e. regardless of enforcement status on the specified date.

intervention.types

Specify the names of the trade policy instruments for your analysis. Default is 'any'. For the permissible values, please see the GTA website or the GTA handbook.

keep.type

Specify whether to focus on ('TRUE') or exclude ('FALSE') interventions with the stated intervention type.

mast.chapters

Specify the MAST chapter IDs for your analysis. Default is 'any'. Permissible values are the MAST chapter letters plus 'tariff', 'fdi', 'migration' and combinations thereof.

keep.mast

Specify whether to focus on ('TRUE') or exclude ('FALSE') interventions with the stated MAST chapter ID.

implementation.level

Specify the government level responsible for the intervention. Default is 'any'. Permissible values are 'supranational', 'national', 'subnational', 'IFI', 'NFI' or combinations thereof. IFI and NFI refer to government-owned financial institutions that are owned by one ('NFI') or more ('IFI') governments.

keep.level

Specify whether to focus on ('TRUE') or exclude ('FALSE') interventions with the stated implementation levels.

eligible.firms

Concentrate the analysis on interventions that are targeted at certain subsets. Default is 'any'. Permissible values are 'all', 'firm-specific', 'SMEs', 'state-controlled','state trading enterprise' or combinations thereof.

keep.firms

Specify whether to focus on ('TRUE') or exclude ('FALSE') interventions with the stated firm subsets.

cpc.sectors

Provide a vector of CPC codes that you are interested in (version 2.1, any digit level).

keep.cpc

Specify whether to focus on ('TRUE') or exclude ('FALSE') interventions with the stated CPC codes.

hs.codes

Provide a vector of HS codes that you are interested in (2012 vintage, any digit level).

keep.hs

Specify whether to focus on ('TRUE') or exclude ('FALSE') interventions with the stated HS codes.

intervention.ids

Provide a vector of intervention IDs.

keep.interventions

Specify whether to focus on ('TRUE') or exclude ('FALSE') the stated intervention IDs.

lag.adjustment

Create a snapshot of the GTA data at the same point in each calendar year since 2009. Specify a cut-off date ('MM-DD').

reporting.period

Specify the period in which an intervention was documented by the GTA team. Default c('2008-11-01',today).

add.unpublished

Including material that is not published (GTA 28 specifc: dumps & subsidies)

df.name

Set the name of the generated result data frame. Default is master.sliced.

pc.name

Set the name of the generated parameter choice data frame. Default is parameter.choice.slicer.

xlsx

Takes value TRUE or FALSE. If TRUE, xlsx file will be stored. Default: FALSE

output.path

Takes the value of the output path (without the filename) added to the working directory as a string starting with "/". Default: None.

Author(s)

Global Trade Alert

References

www.globaltradealert.org


global-trade-alert/gtalibrary documentation built on April 5, 2024, 1:54 p.m.