Load the data from the #TidyTuesday repository:
Filter the data to only look at adult male Collared Brown Lemurs, and extract only the age and weight columns:
Age | Weight |
---|---|
129.90 | 2805 |
132.10 | 3001 |
140.32 | 2429 |
157.94 | 2597 |
164.58 | 2497 |
184.18 | 2225 |
Fit a linear model using Python:
library(reticulate)
library(ggplot2)
lemur_residuals <- py$lemur_data_py
ggplot(data = lemur_residuals,
mapping = aes(x = Predicted,
y = Residuals)) +
geom_point(colour = "#2F4F4F") +
geom_hline(yintercept = 0,
colour = "red") +
theme(panel.background = element_rect(fill = "#eaf2f2",
colour = "#eaf2f2"),
plot.background = element_rect(fill = "#eaf2f2",
colour = "#eaf2f2"))