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:
Some good answers to a very narrow problem, thank you @cderv.
I think I prefer the first method, because my aim would be to enable the user to set the weightings one by one in the Shiny interface to "Knit with params". If I just want to set the weightings in a more hard-coded, less user-friendly manner, I would use the list approach.