When I run R CMD check on my package (Ctrl+Shift+E in RStudio ), it also tests if my examples run without errors.
Unfortunately, there are some examples that should not be run in this context, as they involve external files that are relevant for understanding but not for testing. These are wrapped with \dontrun{} in the ROxygen header.
I know I could use the --no-examples in the R CMD check additional options (RStudio > Build > More > Configure Build Tools), but this would test no example at all, which is not what I want.
Instead, I'd like R CMD check to run devtools::run_examples(run=FALSE, fresh = T), so that examples in \dontrun{} are not ran. This command runs perfectly in the console.
How can I configure R CMD check in RStudio this way?