79 a slightly different approach is to create your formula from a string. In the formula help page you will find the following example : Feb 20, 2013the myformula <- part of that line stores the formula in an object called myformula so you can use it in other parts of your r code.
Other common uses of formula objects in r the lattice. And how to succinctly write a formula with many variables from a data frame? And specifying formula in r with glm without.
What does the capital letter "i" in r linear regression formula mean? Oct 12, 20190 i am attempting to input an equation using r in a loop, and so i am using as.formula and paste. That does job well if the formula is coded statically.