Skip to content
Prev 295454 / 398506 Next

Get variable names from results of lm()

On May 23, 2012, at 1:42 PM, Peter Ehlers wrote:

            
Just to throw out another solution here, the function ?all.vars is helpful:

LM <- lm(Petal.Length ~ ., data = iris)
Petal.Length ~ Sepal.Length + Sepal.Width + Petal.Width + Species
[1] "Petal.Length" "Sepal.Length" "Sepal.Width"  "Petal.Width" 
[5] "Species"  


Regards,

Marc Schwartz