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?
Aha! In my testing, I was using Command-Enter to execute lines of code, which does not materialize the params list, but if I execute a chunk with Command-Option-C, then the list is materialized. Thanks for setting me straight.