Local data storage

In order to simplify loading and working with the Comtrade data with no complications with the databases (relying only on the available RAM) we develop a structure of all data locally in the folders in the ~ (root) folder of the computer. Function build_ct_storage() from the tradeAnalysis package. This function creates a folder ctData in the Documents folder (on Windows Machine) or in ~ folder on any other kind of machine.

Withing this folder there is also an R project created along with the folders for data structure and several R scripts:

Order of running:

  1. open empty R session;

  2. install up to date version of tradeAnalysis package from the git-hub running devtools::install_github("EBukin/tradeAnalysis-pack") in the console;

  3. load the tradeAnalysis package running library(tradeAnalysis);

  4. run command build_ct_storage();

  5. go to your ~ folder (Documents) on Windows machine C:\Users\USER_NAME\Documents;

  6. find the folder ctData and open the project, which is there;

  7. (only if you are doingt this from the outside of FAO building) copy and paste your token (without the quotation marks) onto .CT-token as text. How to access your token is explained on the “Loading COMTRADE data in R”;

  8. open the script update_local_CT_data.R and source it all or run line by line (may take up to several days it this is the first run);

  9. open the script prepare_shinyApp_data.R and source it all or run line by line;

Here you go!

Copyright © 2017 Eduard Bukin. All rights reserved.