If I have a parameterized knitr document with a yaml section with a params block like:
params:
foo: 123
bar: baz
As I develop the document I might like to evaluate code blocks that refer to those variables interactively. But the params
list is only materialized when I actually knit the document. As a result I put in a code block with eval=F
duplicating the parameters. Then I can interactively evaluate that block when testing/developing, but it won't override the variables set in the yaml section if those are changed.
params <- list(foo=123, bar="baz")
Is there a better way to do this that doesn't involve duplicating the parameters?