8  Running Costs, Daily Routine and Checklists

We have introduced quite a few mechanisms. Finally, let’s sort out how much effort each one takes, and summarize the daily routine and a pre-submission checklist.

8.1 Remedies and their cost

Problem Remedy Effort
Code in analysis and the paper diverges Move it to scripts/ as functions (Chapter 2) A little, when moving
Every render recomputes everything targets (Chapter 3) One line in _targets.R per new table/figure
Rendering with stale numbers after forgetting tar_make() Stop at the start of the render with tar_outdated() (Chapter 4) None (automatic)
Transcription errors in numbers in the text num$xxx (Chapter 4) One line in numbers.R per number added
Variable name clashes Prefix with num$ (Chapter 4) None
Broken citation keys check_citations() (Chapter 4) None (automatic)
Can’t view one section at a time Section files + \qi (Chapters 4 and 7) None
Co-authors’ Word edits can’t go back into the qmd Phases A/B, numbers_diff (Chapter 5) Only when sending to co-authors or when the analysis changes
Old notebooks stop working freeze: auto, commit note (Chapter 6) One line per new notebook
Double maintenance in R and Python Finalized processing in R only (Chapter 6) Just agree on the rule

8.1.1 Zero effort (works automatically)

  • The citation check and the forgotten-tar_make() check work just by rendering
  • freeze is a single setting
  • Splitting into section files actually makes things easier to read

8.1.2 Used only occasionally

  • numbers_diff and review_extract from Phase B onward. A few times per paper, but very effective when used

8.1.3 A little effort every time

  • Each time you add a number to the text, add one line to numbers.R and run tar_make(). It is slightly tedious while writing the first draft
    • About 30 seconds each. A paper has 30–50 numbers, so about 20 minutes in total
    • In exchange, transcription errors and double-checking against Excel disappear
  • When adding a table or figure, add one line to _targets.R. A few times per paper
TipTips for reducing the effort
  • At the start of the first draft, write numbers as placeholders such as [OR]. Add them to numbers.R in one go once the results are settled
  • For a small study whose analysis finishes in seconds, dropping targets and computing directly in main.qmd causes no practical problem. This setup pays off most for papers with long revisions and many rounds with co-authors

8.1.4 Not included this time: pinning package versions

Pinning package versions with renv (R) or uv lock (Python) makes it easier to reproduce the same numbers and the same table appearance even in a revision a year later. Balancing the effort, this sample does not include it. For papers likely to go through long revisions, even just running renv::snapshot() at submission gives peace of mind.

8.2 Daily routine

# 1. Explore (try things in analysis/ notebooks; once decided, move them to scripts/ as functions)

# 2. Compute (only what changed)
Rscript -e 'targets::tar_make()'          # \tm in nvim

# 3. Write the manuscript (section files). \qi in nvim for one section, \qp on main.qmd for everything

# 4. Build the docx for submission
quarto render manuscript/jcsm/main.qmd --to docx

8.3 When sending to co-authors (Phase A → Phase B)

Rscript -e 'targets::tar_make()'
quarto render manuscript/jcsm/main.qmd --to docx
Rscript scripts/checks/numbers_diff.R --save      # snapshot the numbers in the text
cp output/manuscript/jcsm/main.docx manuscript/jcsm/review/v1_$(date +%Y%m%d)_sent.docx
git add -A && git commit -m "v1 sent to co-authors"

8.4 When the analysis changes (Phase B)

Rscript -e 'targets::tar_make()'                  # tables and figures are rebuilt automatically
Rscript scripts/checks/numbers_diff.R             # list of numbers that change in the text
# → In Word, search for "old" and replace with "new". Swap tables and figures from output/submission/
Rscript scripts/checks/numbers_diff.R --save      # update the snapshot after replacing

8.5 Pre-submission checklist

Numbers

References

Formatting

Records

8.6 Closing

What made the last 30% of the paper drag on was not the thinking, but work such as transcribing, checking and forgetting to update numbers. The mechanisms in this hands-on either “hand that work to the computer” or “prevent it from happening at all”.

  • Try in analysis/; once decided, move to scripts/
  • Computation in targets; the manuscript only reads
  • Numbers in the text as num$xxx
  • Once sent to co-authors, Word is the master; number changes via numbers_diff

Start by running the sample project, and adopt whatever parts fit your own research.