sub.gadget.formulae.Rd
Replace variables in formulae
An unevaluated R expression or the result of parse.gadget.formulae, e.g. quote(2 + log(moo - 1))
A list of variable names to either: a TimeVariable file, replacement gadget/R formulae, or value
If using TimeVariable files, specify the year to pull out of file
If using TimeVariable files, specify the step to pull out of file
An R expression representing the gadget formulae, which could be run with eval(.., list(moo = 3))
sub.gadget.formulae(quote(log(moo) + oink + baa), list(moo = "#fish", oink = quote(2 + 2), baa = 5))
#> log(fish) + (2 + 2) + 5
# ==> log(fish) + (2 + 2) + 5
if (FALSE) {
tv <- read.gadget.file('.', 'timevariable', file_type = 'timevariable')
sub.gadget.formulae(quote(log(moo) + oink), list(moo = tv), year = 1995, step = 1)
# ==> log(grow1995) + oink
}