The purpose of this project is to show the percentage of foreign-born residents in the State of Florida. The data used to create this map comes from the 2020 U.S. Census. This markdown will explain each of the steps that I used to manipulate the data and complete the project.
I anticipate to find that the highest concentration of foreign-born residents will be centered around the greater Miami area, with increasingly lower percentages the further north the counties are.
The following command collected the Census data for all Florida counties, specifically pulling the number of residents that are foreign-born and the total population of each.
hw <- get_acs(geography = "county", variables = c(foreign_born = "B05012_003", total_pop = "B01003_001"),
state = "FL",
geometry = T,
year = 2022)
From this initial data, I used pivot_wider to place foreign_born and total_pop into their own columns. I then mutated the data, dividing foreign_born by total population and multiplying by 100 to get the foreign-born percentage.
hw_wider <- hw |>
select(-moe) |>
pivot_wider(names_from = variable, values_from = estimate) |>
mutate(foreign_born_percent = foreign_born/total_pop*100)
Finally, I utilized ggplot to graphically represent the data. This final product represents the percentage of foreign-born residents in each county in the State of Florida. The darker the color of a county, the higher the percentage of foreign-born residents.
hw_wider |>
ggplot(aes(fill = foreign_born_percent)) +
geom_sf(color = "white", size = .02) +
scale_fill_viridis_c(option = "magma", direction = -1) +
labs(fill = "Foreign Born Percentage") +
ggtitle("Percentage of Foreign Born Residents by County")
The final product matches my anticipated results. Miami-Dade County has one of the highest concentrations of foreign born residents in the United States. The data I used showed that about 54% of residents in the county are foreign born.
Moving north, the percentage of foreign born residents decreases, however, there is a slight increase in percent around the greater Orlando area, with Osceola county at about 24% and Orange County at 23%.