Makecontrols all the things- Be pedantic about the
makefile, especially as oneRscript may produce many plots and serial objects
- Be pedantic about the
- As a result, all
Rscripts inscripts/are written to be run from the top level directory
When starting out a new report:
- In
~/some-folder-path/PhD/Projects/, runmk-dated-dir a good title cp -R 0000_project-folder-template/ yyyy-mm-dd_a-good-title/cd yyyy-mm-dd_a-good-title/- Run
./run-me-after-copy.shwhich will:trash ./*/.gitignoreto get rid of the.gitignorefiles that only exist so the directory structure of this template is preservedtrash ./.gitto remove this git repository and initialise one for the projecttrash README.md- should only exist in the original template directory and is just notes to myselftrash $0delete itself
- Change the name of the
report-template.rmdfile to something sensible- Change the corresponding entry in the
.gitignorefor the.texfile
- Change the corresponding entry in the
- Change the corresponding value of
WRITEUPin the makefile - Change any other filenames containing
report-template,./run-me-after-copy.shwill tell you what to change. - Comment in/out the relevant things in the
.gitignore
- Use
futile.loggerthroughout the scripts to keep an eye on things- Note that there is a performance penalty for this - should not be used in tight loops
- Sometimes, the
scripts/commonwill be insufficient, and things should really be put in anRpackage - In this case:
- Uncomment the relevant line in the
.gitignore - Initialise a repository inside
package/packagename/ - Add as a submodule to the top level git repo
- Not easy:
git submodule add ./package/pkgname/ ./package/pkgname-sub - Can't avoid duping the submodule
- At least makes it easy to make
makedepend on the submodule and then rerun everything as a result of an update - Whole idea seems a little over-the-top
- Not easy:
Makewill need to know whengit submodule updateis run (TODO: Figure this out)
- Uncomment the relevant line in the
- Store as
.pnguntil one needs the.pdf, uses less of my time overall - Use matching subdirectory names where possible
- Dead dove do not eat
- Again try to match subdirectory names with
plots/, and sometimes scripts
- For all varieties of scripts, usually
R, sometimesC++orsh - Try to use subdirectories for smaller topics
- The
scripts/commonfolder exists as a kind of mid way point between one hugeRfile and a package- The is useful for when I'm not sure if the code will be reused, or the best way to solve some problem I am likely to preform a number of times, without introducing the nonzero amount of overhead that packages introduce (particularly with
StanandC++components that are to be reused)
- The is useful for when I'm not sure if the code will be reused, or the best way to solve some problem I am likely to preform a number of times, without introducing the nonzero amount of overhead that packages introduce (particularly with
- The
report-template.rmdfile makes liberal use of\input{tex-input/\\d{4}-a-tex-file.tex}, for syntax highlighting / editor reasons - The files here also tend to be in subdirectories, which I name after the section of the document
- I name the file as:
0010-appropriate-filename.texand the nexttexfile in the section of the report is named0020-another-appropriate-file.tex- The label is then
(fig|eqn|tbl|alg):appropriate-filename, so that I can easily remember the label names- Sometimes this conflicts because you have
tex-input/example-one/0010-stage-one-target-posterior.tex, andtex-input/example-two/0010-stage-one-target-posterior.tex - Latex will helpfully tell you that you have nonunique labels defined
- Append some identifier to the label? Unsure
- Sometimes this conflicts because you have
- The zero padding on either side of the filename numbering is so that I can easily insert new files without renaming everything the ordering
- The label is then
- The
tex-input/pre.texfile contains all the things thatrmarkdown/knitrput into the header of the resultingreport-template.texfile