Tidying a linear regression model
In the last section, you fit a linear model. Now, you'll use the tidy() function in the broom package to turn that model into a tidy data frame.
Este exercício faz parte do curso
Case Study: Exploratory Data Analysis in R
Instruções do exercício
The US_fit linear model is available in your workspace.
- Load the
broompackage. - Use the
tidy()function frombroomon the model object to turn it into a tidy data frame. Don't store the result; just print the output to the console.
Exercício interativo prático
Experimente este exercício completando este código de exemplo.
# Load the broom package
# Call the tidy() function on the US_fit object