inout_tables_prep: Prepares data for szs and wgts in and out

Description Usage Arguments Details Value See Also Examples

View source: R/inout_tables_prep.R

Description

The output from this function is a list of seizures and weights in and out that has not been adjusted for multiple countries of origin This function interacts with the ETIS database and the list of relevant seizures stored in df.1 from df_quantities_RIE_separate.fn The main use of this function is to contribute to the calculation of two new database tables for law enforcement ratio and trade flow accounting.

Usage

1
2
inout_tables_prep(year.from = 1900, year.to = 2100, statusMin = 3,
  ctry_dest_included, df.1 = df.1)

Arguments

year.from

Starting year

year.to

Ending year

statusMin

Minimum status of seizure record to include in summary (usually 3)

ctry_dest_included

true if ctry of dest included in computing szs out TRUE for trade flows and FALSE for LE ratio accounting

df.1

Dataframe with list of seizure records to be considered. Created using df_quantities_RIE_separate.fn

Details

This program also deals with seizure 109462. One of the countries of transit that is listed occurs after the country of discovery. For that country, the seizure needs to be included in trade flow accounting and excluded from LE ratio accounting

Value

a list with two items df_inout A dataframe listing seizures and weights in and out for each country in each year ctry_dest_included Flag denoting whether or not country of destination included

See Also

df_quantities_RIE_separate, mult_ctries, inout_tables_final

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
year.from <- 1900
year.to <- 2100
statusMin <- 3

df.1 <- df_quantities_RIE_separate(year.from = year.from, year.to = year.to,
statusMin = statusMin, reg.model = 'wt est.Rdata')

mult.dat <- mult_ctries(year.from = 1900, year.to = 2100, statusMin = 3, df.1 = df.1)

ctry_dest_included <- FALSE

df.inout <- inout_tables_prep(year.from = year.from, year.to = year.to,
statusMin = statusMin, ctry_dest_included = ctry_dest_included,
df.1 = df.1)

fmunderwood/ETISdbase documentation built on Feb. 29, 2020, 12:46 a.m.