I am working on a PDF report that includes many analyses, figures and tables, and that needs to be frequently updated. This is read both by people who are interested only in the output (no code), but also by people who want to see the code.
I know I can hide all chunks globally putting knitr::opts_chunk$set(echo=FALSE) at the top of the doc. However, I was wondering whether there is a way to automatically knit two versions of a report, one showing all code chunks, and one hiding them?