Recently Published
(2023) Table of Cameron County Places
This is a table detailing the incorporated and unincorporated communities throughout Cameron County using data spanning from 2023; this represents the most up-to-date information available publicly, as far as I know.
A Census-Designated Place (CDP), per the U.S. Census Bureau, is "...[a] statistical equivalent of [an] incorporated place and represent[s] unincorporated communities that do not have a legally defined boundary or an active, functioning governmental structure."
Source: https://www.census.gov/programs-surveys/bas/information/cdp.html
...
code:
library(easypackages)
libraries(c("readxl", "ggmap", "ggiraph", "ggforce", "ggcorrplot", "ggthemes", "ggsignif", "ggsflabel", "ggrepel", "ggpubr", "ggsci", "glue", "gt", "janitor", "maptools", "mapview", "magrittr", "plyr", "prettyunits", "progress", "progressr", "psych", "rgeos", "rio", "rms", "Hmisc", "robustbase", "rspat", "s2", "sfheaders", "sfweight", "snakecase", "smoothr", "sp", "spatial", "spatialEco", "spatstat", "spatstat.linnet", "spatstat.model", "rpart", "spatstat.explore", "nlme", "spatstat.random", "spatstat.geom", "spatstat.data", "spdep", "sf", "spData", "abind", "summarytools", "terra", "tidycensus", "tidylog", "tidyselect", "lubridate", "forcats", "stringr", "dplyr", "purrr", "readr", "tidyr", "tibble", "ggplot2", "tidyverse", "tigris", "tmap", "vctrs", "viridis", "viridisLite", "vroom", "waldo", "wk", "stats", "graphics", "grDevices", "utils", "datasets", "methods", "base", "haven", "foreign", "survey", "srvyr", "sitrep", "questionr", "srvyr", "stringr"))
##tigris package, pulls Census data
TX_places<- places(state = "TX", cb = FALSE, year = 2023)
cam_pop_tracts<- get_acs("tract", table = "B01001", state = "TX", county = "Cameron", year= 2022, survey = "acs5", geometry = TRUE)
# colonias data available through the Texas OAG database via filtering
# https://texasoag.maps.arcgis.com/apps/webappviewer/index.html?id=1bc9c4f7b1da47dd8fc535fbd17dc060
# the file I'm using comes from the Cameron County DOT though, I'm pretty sure, circa 05/2022
colonias_sf<- read_sf(dsn = "E:/COLONIAS/COLONIAS.shp")
## Step 1: (after loading everything in) make a "cookie cutter" to filter the places data
cam_pop_tracts %>% st_as_sf(.) %>% st_union(.) -> cam_union
## Step 2: Cookie Cut!
st_intersection(TX_places, cam_union) -> cam_places
## Step 3: Make the table of places
cam_places %>% mutate(TYPE = str_remove(NAMELSAD, paste0(NAME)) %>% str_squish(.) %>% toupper(.)) %>% st_drop_geometry(.) %>% arrange(., desc(TYPE)) %>% gt(.) %>% cols_align("center") %>% opt_stylize("4")
Program-15
Compiling programs from 9-15.
(2023) Cameron County Places and Colonia Map
This is a map detailing the incorporated and unincorporated communities throughout Cameron County using data spanning from 2022 to 2023; this represents the most up-to-date information available publicly, as far as I know.
A Census-Designated Place (CDP), per the U.S. Census Bureau, is "...[a] statistical equivalent of [an] incorporated place and represent[s] unincorporated communities that do not have a legally defined boundary or an active, functioning governmental structure."
Source: https://www.census.gov/programs-surveys/bas/information/cdp.html
...
code:
library(easypackages)
libraries(c("readxl", "ggmap", "ggiraph", "ggforce", "ggcorrplot", "ggthemes", "ggsignif", "ggsflabel", "ggrepel", "ggpubr", "ggsci", "glue", "gt", "janitor", "maptools", "mapview", "magrittr", "plyr", "prettyunits", "progress", "progressr", "psych", "rgeos", "rio", "rms", "Hmisc", "robustbase", "rspat", "s2", "sfheaders", "sfweight", "snakecase", "smoothr", "sp", "spatial", "spatialEco", "spatstat", "spatstat.linnet", "spatstat.model", "rpart", "spatstat.explore", "nlme", "spatstat.random", "spatstat.geom", "spatstat.data", "spdep", "sf", "spData", "abind", "summarytools", "terra", "tidycensus", "tidylog", "tidyselect", "lubridate", "forcats", "stringr", "dplyr", "purrr", "readr", "tidyr", "tibble", "ggplot2", "tidyverse", "tigris", "tmap", "vctrs", "viridis", "viridisLite", "vroom", "waldo", "wk", "stats", "graphics", "grDevices", "utils", "datasets", "methods", "base", "haven", "foreign", "survey", "srvyr", "sitrep", "questionr", "srvyr", "stringr"))
##tigris package, pulls Census data
TX_places<- places(state = "TX", cb = FALSE, year = 2023)
cam_pop_tracts<- get_acs("tract", table = "B01001", state = "TX", county = "Cameron", year= 2022, survey = "acs5", geometry = TRUE)
# colonias data available through the Texas OAG database via filtering
# https://texasoag.maps.arcgis.com/apps/webappviewer/index.html?id=1bc9c4f7b1da47dd8fc535fbd17dc060
# the file I'm using comes from the Cameron County DOT though, I'm pretty sure, circa 05/2022
colonias_sf<- read_sf(dsn = "E:/COLONIAS/COLONIAS.shp")
## Step 1: (after loading everything in) make a "cookie cutter" to filter the places data
cam_pop_tracts %>% st_as_sf(.) %>% st_union(.) -> cam_union
## Step 2: Cookie Cut!
st_intersection(TX_places, cam_union) -> cam_places
## Step 3: Make the map of places (unincorporated)
cam_places %>% mutate(TYPE = str_remove(NAMELSAD, paste0(NAME)) %>% str_squish(.) %>% toupper(.)) %>% st_as_sf(.) %>% tm_shape(.) + tm_polygons(col = "TYPE", popup.vars = c("NAME", "TYPE"), alpha = 0.6) + tm_basemap("OpenStreetMap") -> bigboss_CDP_map
## Step 4 (optional): Show relevant colonias too based on size using "tm_bubbles"
bigboss_CDP_map + tm_shape(st_make_valid(st_as_sf(colonias_sf))) + tm_bubbles(size="EST_POP", fill = "COLONIA_NM", col="purple", alpha = 0.4, popup.vars=c("COLONIA_NM", "EST_POP", "INCORPORAT"))