# To build this vignette run devtools::build_vignettes() # Then rebuild the package CTRL+SHIFT+B so that the vignette is # integrated to the package documentation
This package can be installed with the devtools package.
library(devtools) install_bitbucket("paul4forest/tradeflows")
If the devtools package is not installed on your system.
install.packages("devtools")
You may need to upgrade the libcurl library on your system's command line
sudo apt-get install libcurl4-gnutls-dev
Database configuration file and column names are located under the local package installation directory. This directory is shown by the R command:
system.file("config", package="tradeflows")
Database connection parameters can be entered in the databaseconfig.R file.
Load the package and use the database configuration with the commands:
library(tradeflows) setdatabaseconfig(reload=TRUE)
The database configuration file can be edited and reloaded.
setdatabaseconfig(reload=TRUE)
displays the location of the database configuration file.
The configuration table columnnames located in config/column_names.csv contains columns specifying which efi columns names are used in the trade flows database raw_flow and validated_flow tables.
Start by looking at files in the R/ directory
The function cleandb() will feed data into the database table(s) validated_flow updates will be done on a product basis, at the 6 digit level. The cleaning script will:
The clean() function can also run from a bash shell (your system's command line)
Rscript -e 'library(tradeflows)' -e 'cleandbproduct(440799, tableread = "raw_flow_yearly", tablewrite = "validated_flow_yearly")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.