The data set used here is The United States Wind Turbine Database which shows the locations of land based and offshore wind turbines in the United States, it shows many things but in this project selected the state (t_state), county (t_county), name of the wind power project that the turbine is a part of (p_name), number of turbines (p_tnum), cumulative capacity of all turbines in Megawatts (p_cap), longitude (xlong),and latitude (ylat). The data came from USGS https://energy.usgs.gov/uswtdb/data/ . Why choose this data set? This data set is on wind turbines and this is a data course and data centers require a lot of energy which wind turbines produce, although I don’t know if wind is a viable solution this is the reasoning.
library(leaflet)library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.4 ✔ readr 2.1.5
✔ forcats 1.0.1 ✔ stringr 1.5.2
✔ ggplot2 4.0.0 ✔ tibble 3.3.0
✔ lubridate 1.9.4 ✔ tidyr 1.3.1
✔ purrr 1.1.0
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(tidyr)
uswtdb_V8_1_20250522.csv SYB67_246_202411_Population Growth, Fertility and Mortality Indicators.csv
Loading data set
uswt <-read_csv("uswtdb_V8_1_20250522.csv")
Rows: 76051 Columns: 28
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (10): faa_ors, faa_asn, t_state, t_county, t_fips, p_name, t_manu, t_mod...
dbl (18): case_id, usgs_pr_id, eia_id, p_year, p_tnum, p_cap, t_cap, t_hh, t...
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
uswtsg <- uswts ggplot(uswtsg, aes(x = t_state, y = p_cap, fill = p_tnum,)) +geom_col(position =position_dodge(width =5), width = .4) +scale_fill_gradient(low ="yellow", high ="blue", name ="Number of turbines in the wind power project.") +geom_vline(xintercept ="NM", color ="black", linetype ="dotdash") +geom_text(x ="NM", y =1088, label ="Part of Western Spirit", size =2) +labs (title ="states cumulative capacity of all turbines in the wind power project in megawatts (MW) ",x="State",y="cumulative capacity of all turbines in the wind power project in megawatts (MW)",caption="Source: USGS") +theme_minimal(base_size =5) +uswtsg
Warning: Removed 2935 rows containing missing values or values outside the scale range
(`geom_col()`).
popupwt <-paste0("<b>State: </b>", uswts$t_state, "<br>","<b>County: </b>", uswts$t_county, "<br>","<b>Number of turbines: </b>", uswts$p_tnum, "<br>","<b>Cumulative capacity of all turbines (Megawatts): </b>", uswts$p_cap, "<br>","<b>Name of the wind power project that the turbine is a part of: </b>", uswts$p_name, "<br>" )