cleandbproduct: Write flows into the database table validated_flow

Description Usage Arguments Value

View source: R/clean.R

Description

For one product (at the 6 digit level), read and clean all trade flows, then Write flows into the database table(s) validated_flow updates will be done on a product basis, The function will:

  1. Read all flows having the given productcode in tableread

  2. Delete all flows having the given productcode in tablewrite (between all reporter and partner countries in all years)

  3. Use clean() to clean the data frame

  4. Write validated flows to tablewrite

Usage

1
cleandbproduct(productcode, tableread, tablewrite, ...)

Arguments

productcode

code of the product trade flows to be validated

tableread

name of the table to read from

tablewrite

name of the table to write to (all rows for productcode will be deleted in this table before writing)

...

further arguments passed to the clean function

Value

TRUE if write to db succesded, otherwise return FALSE


paul4forest/tradeflows documentation built on Oct. 8, 2019, 10:35 a.m.