Skip to content

Commit b0259a1

Browse files
Jasper WoutersJasper Wouters
authored andcommitted
fix code for height vs girth
1 parent 4915325 commit b0259a1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

05-prediction.Rmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -720,14 +720,14 @@ library(ggplot2)
720720
721721
trees %>%
722722
ggplot() +
723-
geom_point(aes(Height, Girth))
723+
geom_point(aes(Girth, Height))
724724
```
725725

726726
From the looks of this plot, the relationship looks approximately linear, but to visually make this a little easier, we'll add a line of best first to the plot.
727727

728728
```{r}
729729
trees %>%
730-
ggplot(aes(Height, Girth)) +
730+
ggplot(aes(Girth, Height)) +
731731
geom_point() +
732732
geom_smooth(method = "lm", se = FALSE)
733733
```
@@ -740,7 +740,7 @@ Now that that's established, we can run the linear regression. To do so, we'll u
740740

741741
```{r}
742742
## run the regression
743-
fit <- lm(Girth ~ Height , data = trees)
743+
fit <- lm(Height ~ Girth , data = trees)
744744
```
745745

746746
### Model Diagnostics

0 commit comments

Comments
 (0)