gta_intervention_duration: GTA intra-year duration calculator

View source: R/gta intervention duration.R

gta_intervention_durationR Documentation

GTA intra-year duration calculator

Description

Computes the share of each calendar year that each intervention was in force.

Usage

gta_intervention_duration(
  data.path = "data/master_plus.Rdata",
  is.data.frame = FALSE,
  years = NULL,
  current.year.todate = TRUE,
  df.name = "intervention.duration",
  pc.name = "parameter.choice.duration"
)

Arguments

data.path

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

is.data.frame

Specify if the data path is a data frame in the current environment. Default is FALSE. If you supply a data frame, the first three columns need to be (1) intervention ID, (2) implementation date, (3) removal date. In that order.

years

The calendar years for which to calculate the shares. Calculation includes interventions based on enforcement status, not implementation date i.e. if you start in 2010, this function will also work with interventions implemneted in 2009 but still in force in 2010. Specify as c(start.year, end.year). Default is c(2008,CURRENT.YEAR).

current.year.todate

Should the duration for the current year, if included, be calculated as 'share of year to date' (TRUE) or 'share of entire current year' (FALSE). Default is TRUE.

df.name

Set the name of the generated result data frame. Default is intervention.duration.

pc.name

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

Value

Output is two data frames. First data frame includes the share of each year that in intervention was in force. Second data frame states parameter choices.

Author(s)

Global Trade Alert

References

www.globaltradealert.org


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