Creating a map involves more than technical execution; it’s also about effective communication.
Ensure that the map is easy to read. This involves choosing appropriate color contrasts, avoiding clutter, and using legible fonts. Colors should accurately represent the data. For sequential data, use gradients; for diverging data, use a color scheme that highlights the midpoint. Maps can be misleading if not properly designed. Pay attention to data classification methods and avoid distorting the data’s message. When dealing with social justice data, be mindful of the potential impact. Present the data respectfully and responsibly, acknowledging any limitations.
Let’s think about income inequality and how it manifests across different regions of the United States. Median household income is a powerful indicator of economic opportunity and well-being, often reflecting disparities in access to education, healthcare, and other essential resources. By mapping this data at the county level, we can visualize economic divides that persist across the nation, highlighting areas that may require targeted social and policy interventions.
# Fetch median household income for all counties in the US
income_data <- get_acs(
geography = "county",
variables = "B19013_001", # Variable for median household income
year = 2022, # Specify the year (most recent available year)
survey = "acs5", # Use the 5-year ACS data for better county-level estimates
geometry = TRUE
)
# Plot the data using ggplot2
income_data %>%
filter(!str_detect(NAME, "\\, Alaska|\\, Hawaii")) %>%
ggplot +
geom_sf(aes(fill = estimate), color = "white", size = 0.1) + # Use 'estimate' for median income
scale_fill_viridis_c(option = "plasma", name = "Median Income") + # Use a color scale for income
theme_minimal() +
labs(
title = "Median Household Income by County (2022)",
subtitle = "Source: ACS 5-Year Estimates",
caption = "Note: White lines represent county boundaries"
) +
theme(
axis.text = element_blank(),
axis.title = element_blank(),
panel.grid = element_blank()
)
How to make this map more readable is something that requires a great deal of thought!
Air quality is a crucial environmental justice issue, as marginalized communities are disproportionately affected by pollution and its adverse health effects. PM2.5 refers to fine particulate matter that is 2.5 micrometers or smaller in diameter, small enough to be inhaled deeply into the lungs and even enter the bloodstream. These particles come from sources like vehicle emissions, industrial processes, and wildfires, and prolonged exposure to PM2.5 is associated with serious health problems, including respiratory and cardiovascular diseases. Mapping PM2.5 pollution levels across California can reveal spatial patterns of exposure, identifying communities that are most impacted. This type of analysis is vital for advocating policy changes to reduce pollution and to protect vulnerable populations
# Read in pollution data
p25data <- read.csv("https://drive.google.com/uc?export=download&id=1XYIk6_dn2V5GrnPP77x1dNMoB2YRoxqW")
# Step 1: Calculate the average PM2.5 concentration for each site
p25data <- p25data %>%
group_by(Site.ID, Site.Latitude, Site.Longitude) %>%
summarize(average_PM25 = mean(Daily.Mean.PM2.5.Concentration, na.rm = TRUE)) %>%
ungroup()
# We have California counties from earlier
# Plot California counties with pollution data overlay
ggplot(p25data) +
geom_sf(data = state_counties, fill = "white", color = "black") + # Map of California counties
geom_point(
aes(x = Site.Longitude, y = Site.Latitude, color = average_PM25),
size = 1.5, alpha = 0.8 # Small, uniform dot size
) +
scale_color_viridis_c(name = "Avg PM2.5", option = "inferno") + # Broad color range with "inferno" palette
theme_minimal() +
theme(
panel.grid = element_blank()
)
To create a comprehensive dataset of election results by county for your assigned state, follow the steps below. This project will involve extracting, organizing, and preparing data for analysis.
Each of you has been assigned a state to focus on. Start with MSNBC’s
main presidential election map. Click on your assigned state to view
the state-specific election results. Scroll down on your state’s
election results page and click the “View All Counties” link to display
detailed results for each county. Print the web page to a
.pdf
file. Ensure that all relevant county data is visible
and captured in the document.
Next, go to Google
NotebookLM, start a new notebook, and upload the .pdf
file as a source document. Use NotebookLM to extract the data in
comma-separated (.csv) format. Here are some guidelines for structuring
the data:
Either download the .csv
file from NotebookLM (if
provided) or copy the comma-separated text into a plaintext editor and
save it as a .csv
file. Name the file after your state, for
example: Pennsylvania.csv
or New Mexico.csv
.
Finally, place your .csv
file in the shared Google Drive
for this project.