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.
- Save codes for tables and figures in the paper for convince (very important)
- Keep notes on results in a file
- Fold management (pdfs, results, codes……)
- 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.
- Each Figure corresponds to a R file to produce it. (Figure1.pdf => Figure1.R)
- Name the files and functions to be understandable.
- Add some explanations to the codes
- A simple principle: put all related codes/results/pdfs in the same folder.
- Be careful with the determinations (If, while, or ……), always design a full loop.