Skip to content

Instantly share code, notes, and snippets.

@adisarid
Created October 27, 2020 23:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adisarid/66ace78d77575ec9ad070b762b33c4b6 to your computer and use it in GitHub Desktop.
Save adisarid/66ace78d77575ec9ad070b762b33c4b6 to your computer and use it in GitHub Desktop.
library(tidyverse)
wind_turbine <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-10-27/wind-turbine.csv')
p1 <- ggplot(wind_turbine, aes(x = rotor_diameter_m, y = turbine_rated_capacity_k_w)) +
geom_point() +
stat_smooth(method = "lm") +
ggtitle("Capacity vs rotor diameter") +
ylab("Capacity [kW]") +
xlab("Rotor diameter [m]")
p2 <- ggplot(wind_turbine, aes(x = hub_height_m, y = turbine_rated_capacity_k_w)) +
geom_point() +
stat_smooth(method = "lm") +
ggtitle("Capacity vs hub height") +
ylab("Capacity [kW]") +
xlab("Hub height [m]")
library(patchwork)
p1 + p2
lm1 <- lm(data = wind_turbine, formula = turbine_rated_capacity_k_w ~ hub_height_m + rotor_diameter_m)
lm1 %>%
summary()
gtsummary::tbl_regression(lm1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment