Re: [R] update.formula() to add interaction terms

2014-02-04 Thread Marie-Pierre Sylvestre
l Message- > > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf > > Of Marie-Pierre Sylvestre > > Sent: Monday, February 03, 2014 12:54 PM > > To: r-help@r-project.org > > Subject: [R] update.formula() to add interaction

Re: [R] update.formula() to add interaction terms

2014-02-03 Thread William Dunlap
p-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf > Of Marie-Pierre Sylvestre > Sent: Monday, February 03, 2014 12:54 PM > To: r-help@r-project.org > Subject: [R] update.formula() to add interaction terms > > Hi, > I have a list of formulae that I

[R] update.formula() to add interaction terms

2014-02-03 Thread Marie-Pierre Sylvestre
Hi, I have a list of formulae that I need to modify. For each formula, I need to add an interaction term between the first independent variable and the last one. I want to write a function to achieve that because the list of formulae to modify is long. For example, if the formula is y ~ x1 + x2 +