Skip to content

Instantly share code, notes, and snippets.

@seasmith
Created July 21, 2019 03:51
Show Gist options
  • Save seasmith/8464ffddb354a2c9cc3f244b2e01f210 to your computer and use it in GitHub Desktop.
Save seasmith/8464ffddb354a2c9cc3f244b2e01f210 to your computer and use it in GitHub Desktop.
Modeling with the iris data set
library(broom) # alt to par(mfrow(2,2)); plot(mod)
library(rsample)
library(dplyr)
library(ggplot2) # alt to par(mfrow(2,2)); plot(mod)
set.seed(1492)
ifrac <- initial_split(iris)
iris_test <- testing(ifrac)
iris_trian <- training(ifrac)
f1 <- Petal.Length ~ Sepal.Length
iris_lm_1a <- lm(f1, data = iris)
iris_tidy_1a <- glance(iris_lm_1a)
iris_glance_1a <- tidy(iris_lm_1a)
iris_augment_1a <- augment(iris_lm_1a)
glimpse(iris_tidy_1a)
glimpse(iris_glance_1a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment