rdinnager / slimr

Run and Analyse SLiM Population Genetics Forward Simulations from R.
https://rdinnager.github.io/slimr
Other
7 stars 1 forks source link

Add `inlines` argument to `slim_script_render` #52

Closed rdinnager closed 1 year ago

rdinnager commented 3 years ago

inlines would be a named list of objects to inline, the names referring to the names referenced in the slimr_inline() call and the values being the objects themselves. Could also be a list of named lists, in which case its length should match that of the template argument. Could also accept a tibble? It would have list columns for object to be inlined, with the column name specifying the object names for inlining. Again, it should be the same length as template (unless template has length one, in which case we broadcast it to the length of inlines). This could be a better option than making sure slimr_template() works inside slimr_inline() (e.g. see #43)

rdinnager commented 1 year ago

This now seems an overly complicated solution. Simpler seems to allow r_template() to accept more complicated objects by using r_inline() internally. Closing for now.