p2_110

https://www.publicdomainpictures.net/en/view-image.php?image=131041&picture=wind-turbine

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.

Selecting columns that might be used

uswts <- uswt |>
  select(t_state, t_county, p_name, p_year, p_tnum, p_cap, t_model, xlong, ylat)

First visualization

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()`).

Step 1 Map

leaflet() |>
  setView(lng = -95.712891, lat = 37.09024, zoom =4.4) |>
  addProviderTiles("Esri.WorldStreetMap") |>
  addCircles(
    data = uswts,
    lng = ~ xlong,
    lat = ~ ylat,
    radius = uswts$p_cap
)

Adding tool tip for map

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>"
    )

Final map with tool tip

leaflet() |>
  setView(lng = -95.712891, lat = 37.09024, zoom = 4.4) |>
  addProviderTiles("Esri.WorldStreetMap") |>
  addCircles(
    data = uswts,
    lng = ~ xlong,
    lat = ~ ylat,
    radius = sqrt(1.02^uswts$p_cap) * 3,
    color = "green",
    fillColor = "lightblue",
    fillOpacity = 0.35,
    popup = popupwt
  )

The first visualization shows different states cumulative capacity of all turbines in the wind power project in megawatts the x axis is the states, the y axis is the cumulative capacity of all turbines in the wind power project in megawatts and the color shows how many turbines are there. The map shows the location of the turbines as well as County, name of the wind power project that the turbine is a part of, number of turbines, and cumulative capacity of all turbines in megawatts. One thing that might be interesting is that New Mexico had the most turbines and largest cumulative capacity. some things that would have made the visualizations better but could not get to work was the radius to represent the capacity of the turbines, you can clearly see new mexico had the highest but most of the other ones look about the same size. maybe it needs a different equation for the radius for each state. another thing that would have made it better is adding color to the map to show how many turbines where there.

The data came from USGS https://energy.usgs.gov/uswtdb/data/