Proper method to append to a formula where both formula and stuff to be appended are arguments
问题 I've done a fair amount of reading here on SO and learned that I should generally avoid manipulation of formula objects as strings, but I haven't quite found how to do this in a safe manner: tf <- function(formula = NULL, data = NULL, groups = NULL, ...) { # Arguments are unquoted and in the typical form for lm etc # Do some plotting with lattice using formula & groups (works, not shown) # Append 'groups' to 'formula': # Change y ~ x as passed in argument 'formula' to # y ~ x * gr where gr is