View source: R/gta intervention duration.R
gta_intervention_duration | R Documentation |
Computes the share of each calendar year that each intervention was in force.
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"
)
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. |
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.
Global Trade Alert
www.globaltradealert.org
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.