write2csv_spread: Spread quantity data along the period and write to a csv file...

Description Usage Arguments Details Value Examples

Description

Spread quantity data along the period and write to a csv file Write a data frame containing trade flows to a csv file

Usage

1
2
3
4
5
formatflows(dtf)

write2csv_spread(dtf, csvfile)

write2csv_long(dtf, csvfile)

Arguments

dtf

a data frame containing validated trade flows

csvfile

character path to a csv file

Details

formatflows edits information so that the exported data is more pleasant to use. For example missing partner is replaced by the partnercode Long descriptions are truncated.

Value

The input data frame invisibly

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run:  # Clean product and country codes
con <- RMariaDB::dbConnect(RMariaDB::MariaDB(), dbname = "test")
csvfile <- tempfile(fileext = ".csv")
loadflows(con, productanalysed = "44071190", periodstart = 201700, 
          tableread = "vld_comext_monthly") %>% 
    write2csv_spread(csvfile)
readLines(csvfile,5) # Check the first lines of the csv file
RMariaDB::dbDisconnect(con)

## End(Not run)

stix-global/eutradeflows documentation built on Nov. 13, 2020, 9:23 p.m.