I would quite like to do something like the following in an RMarkdown YAML header:
---
params:
weightings:
a: 11
b: 12
...
---
so that I could then do this in the body of the document:
weightings <- unlist(params$weightings)
rather than
weightings <- c(params$weightings$a, params$weightings$b, ...)
Of course that YAML approach above doesn't work for params
, because when you indent under params you are expected to be providing labels and values for the Shiny parameters interface.
Does anyone else think that such a nesting feature for params
would be useful? Or is there a way to do this currently, that I haven't thought of?
My best approach currently would be something like:
---
params:
weighting_a: 11
weighting_b: 12
...
---
weightings <- unlist(subset(params, grepl("^weighting", names(params))))