Skip to content

Commit

Permalink
Fix missing pipe
Browse files Browse the repository at this point in the history
  • Loading branch information
mine-cetinkaya-rundel committed Nov 12, 2023
1 parent 336cd4a commit 67a0e50
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions exercises/_07-ex-model-slr.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ The scatterplots shown below each have a superimposed regression line. If we wer
df <- tibble(
x = seq(1, 100, 1),
y_linear = 3 * x + 5 + rnorm(length(x), mean = 0, sd = 20),
y_fan_back = 4 * x + 5 + rnorm(length(x), mean = 0, sd = sort(1.3 * x, decreasing = TRUE))
) |
y_fan_back = 4 * x + 5 + rnorm(length(x), mean = 0, sd = sort(1.3 * x, decreasing = TRUE))
) |>
pivot_longer(cols = -x, names_to = "type", values_to = "y") |>
arrange(type) |>
mutate(type_label = if_else(type == "y_linear", "(a)", "(b)"))

ggplot(df, aes(x = x, y = y)) +
geom_point(size = 2, alpha = 0.8) +
geom_smooth(method = "lm", se = FALSE, color = "black", size = 0.8) +
geom_smooth(method = "lm", se = FALSE, color = "black", linewidth = 0.8) +
facet_wrap(~type_label) +
theme(axis.text = element_blank()) +
labs(x = NULL, y = NULL)
Expand Down

0 comments on commit 67a0e50

Please sign in to comment.