Tips on Coding

The code for simulations in the paper should be detailed, and one can get results by one-click. Must remember this, just for saving time and reducing the tedious work.

  1. Save codes for tables and figures in the paper for convince (very important)
  2. Keep notes on results in a file
  3. Fold management (pdfs, results, codes……)
  4. The simulation results should be well organized in a fold with simulation settings and aims in a readme file, with code for produce Figures and Tables in the folder. The figures and Tables are named according to the name in the paper.
  5. Each Figure corresponds to a R file to produce it. (Figure1.pdf => Figure1.R)
  6. Name the files and functions to be understandable.
  7. Add some explanations to the codes
  8. A simple principle: put all related codes/results/pdfs in the same folder.
  9. Be careful with the determinations (If, while, or ……), always design a full loop.