Scope augment call
This commit is contained in:
parent
6d5cb638f2
commit
42bb4f8fe0
|
@ -663,7 +663,7 @@ A model is a type of summary that describes the relationships in your data. You
|
||||||
```{r echo = FALSE}
|
```{r echo = FALSE}
|
||||||
diamonds2 <- filter(diamonds, x > 3, y > 3, y < 12)
|
diamonds2 <- filter(diamonds, x > 3, y > 3, y < 12)
|
||||||
diamond_mod <- lm(y ~ x, data = diamonds2)
|
diamond_mod <- lm(y ~ x, data = diamonds2)
|
||||||
resids <- augment(diamond_mod)
|
resids <- broom::augment(diamond_mod)
|
||||||
diamonds3 <- bind_rows(filter(resids, abs(.resid) > 0.5),
|
diamonds3 <- bind_rows(filter(resids, abs(.resid) > 0.5),
|
||||||
sample_n(filter(resids, abs(.resid) <= 0.5), 1000)) %>%
|
sample_n(filter(resids, abs(.resid) <= 0.5), 1000)) %>%
|
||||||
select(x, y)
|
select(x, y)
|
||||||
|
|
Loading…
Reference in New Issue