Skip to content

Commit

Permalink
Submit border patrol data to Tidy Tuesday (#770)
Browse files Browse the repository at this point in the history
* Submit border patrol data to Tidy Tuesday

* Applied changes requested by @jonthegeek

* Moved article to GitHub pages and updated image alt text to note that I created the plot

* Accept submission

* Update data/2024/2024-11-26/readme.md

* Update data/2024/2024-11-26/readme.md

---------

Co-authored-by: jonthegeek <[email protected]>
Co-authored-by: Jon Harmon <[email protected]>
  • Loading branch information
3 people authored Nov 22, 2024
1 parent ba56073 commit c9b8b7e
Show file tree
Hide file tree
Showing 8 changed files with 123,870 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ If you are using TidyTuesday to teach data-related skills, [please let us know](
| 45 | `2024-11-05` | [Democracy and Dictatorship](data/2024/2024-11-05/readme.md) | [democracyData R Package](https://xmarquez.github.io/democracyData/index.html) | [Regime types and regime change: A new dataset on democracy, coups, and political institutions](https://link.springer.com/article/10.1007/s11558-019-09345-1) |
| 46 | `2024-11-12` | [ISO Country Codes](data/2024/2024-11-12/readme.md) | [ISOcodes R Package](https://cran.r-project.org/package=ISOcodes) | [ISO 3166 on Wikipedia](https://en.wikipedia.org/wiki/ISO_3166) |
| 47 | `2024-11-19` | [Bob's Burgers Episodes](data/2024/2024-11-19/readme.md) | [bobsburgersR R Package](https://github.com/poncest/bobsburgersR) | [Bob’s Burgers Episode Fingerprints by Season](https://stevenponce.netlify.app/projects/standalone_visualizations/sa_2024-11-11.html) |
| 48 | `2024-11-26` | [U.S. Customs and Border Protection (CBP) Encounter Data](data/2024/2024-11-26/readme.md) | [U.S. Customs and Border Protection](https://www.cbp.gov/) | [U.S. Border Patrol Encounters](https://gdatascience.github.io/us_border_patrol_encounters/us_border_patrol_encounters.html) |

***

Expand Down
68,816 changes: 68,816 additions & 0 deletions data/2024/2024-11-26/cbp_resp.csv

Large diffs are not rendered by default.

54,940 changes: 54,940 additions & 0 deletions data/2024/2024-11-26/cbp_state.csv

Large diffs are not rendered by default.

Binary file added data/2024/2024-11-26/inadmissible-aliens-plot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions data/2024/2024-11-26/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
title: "U.S. Customs and Border Protection (CBP) Encounter Data"
article:
title: "U.S. Border Patrol Encounters"
url: "https://gdatascience.github.io/us_border_patrol_encounters/us_border_patrol_encounters.html"
data_source:
title: "U.S. Customs and Border Protection"
url: "https://www.cbp.gov/"
images:
# Please include at least one image, and up to three images
- file: "inadmissible-aliens-plot.png"
alt: >
A stacked bar plot (created by Tony Galvan, but inspired by @fentasyl on X) showing monthly inadmissible CHNV (Cuban, Haitian, Nicaraguan, and Venezuelan) alien encounters by U.S. Border Patrol agents from 2020 to 2024, based on data from U.S. Customs and Border Protection. Bars represent total monthly encounters, with the blue portion indicating Southern Border encounters and the red portion indicating Interior encounters. From 2020 to 2022, encounters are consistently below 10,000 per month, predominantly at the Southern Border. Starting in 2023, encounters surge dramatically, ranging from 10,000 to 60,000 per month, with Southern and Interior encounters roughly equal. The data appears inaccurately low for late 2023.
credit:
# We want to thank you for curating this dataset! If you do not want a
# particular type of credit, please delete the related line.
post: "Tony Galván"
linkedin: "https://www.linkedin.com/in/anthony-raul-galvan"
twitter: "@GDataScience1"
github: "https://github.com/gdatascience"
91 changes: 91 additions & 0 deletions data/2024/2024-11-26/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# U.S. Customs and Border Protection (CBP) Encounter Data

This week we're exploring [U.S. Customs and Border Protection (CBP) encounter data](https://www.cbp.gov/document/stats/nationwide-encounters):

> Encounter data includes U.S. Border Patrol Title 8 apprehensions, Office of Field Operations Title 8 inadmissibles, and all Title 42 expulsions for fiscal years 2020 to date. Data is available for the Northern Land Border, Southwest Land Border, and Nationwide (i.e., air, land, and sea modes of transportation) encounters. Data is extracted from live CBP systems and data sources. Statistical information is subject to change due to corrections, systems changes, change in data definition, additional information, or encounters pending final review. Final statistics are available at the conclusion of each fiscal year.
Thank you to [Tony Galván](https://www.linkedin.com/in/anthony-raul-galvan/) for curating this dataset and providing a [blog post](https://gdatascience.github.io/us_border_patrol_encounters/us_border_patrol_encounters.html) that explores the data in more detail.

- How has the implementation (and potential end) of Title 42 affected migration and enforcement trends compared to Title 8 actions?
- What are the key differences in migration patterns and enforcement activity between the Northern and Southwest Land Borders?
- Are there seasonal or year-over-year trends in encounters that can help predict future migration patterns?

## The Data

```r
# Option 1: tidytuesdayR package
## install.packages("tidytuesdayR")

tuesdata <- tidytuesdayR::tt_load('2024-11-26')
## OR
tuesdata <- tidytuesdayR::tt_load(2024, week = 48)

cbp_resp <- tuesdata$cbp_resp
cbp_state <- tuesdata$cbp_state

# Option 2: Read directly from GitHub

cbp_resp <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2024/2024-11-26/cbp_resp.csv')
cbp_state <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2024/2024-11-26/cbp_state.csv')
```

## How to Participate

- [Explore the data](https://r4ds.hadley.nz/), watching out for interesting relationships. We would like to emphasize that you should not draw conclusions about **causation** in the data. There are various moderating variables that affect all data, many of which might not have been captured in these datasets. As such, our suggestion is to use the data provided to practice your data tidying and plotting techniques, and to consider for yourself what nuances might underlie these relationships.
- Create a visualization, a model, a [shiny app](https://shiny.posit.co/), or some other piece of data-science-related output, using R or another programming language.
- [Share your output and the code used to generate it](../../../sharing.md) on social media with the #TidyTuesday hashtag.
- [Submit your own dataset!](../../../.github/pr_instructions.md)

### Data Dictionary

# `cbp_resp.csv`

|variable |class |description |
|:----------------------|:---------|:-------------------------------------|
|fiscal_year |integer |The fiscal year the encounter took place |
|month_grouping |character |Allows for comparisons between completed FY months vs. those remaining |
|month_abbv |character |The month the encounter took place (abbreviated, eg "APR") |
|component |character |Which part of CBP was involved in the encounter ("Office of Field Operations" or "U.S. Border Patrol") |
|land_border_region |character |The border region in which the encounter occurred ("Northern Land Border", "Southwest Land Border", or "Other"); border regions are defined by each component. Nationwide numbers are calculated by adding together Northern Land Border, Southwest Land Border, and Other regions |
|area_of_responsibility |character |The field office or sector where the encounter occurred |
|aor_abbv |character |The field office or sector where the encounter occurred (abbreviated) |
|demographic |character |Categories under which individuals were encountered based on factors such as age, admissibility, and relationship (FMUA = Individuals in a Family Unit; UC = Unaccompanied Children) |
|citizenship |character |Citizenship of the individual encountered |
|title_of_authority |character |The authority under which the noncitizen was processed (Title 8: The standard U.S. immigration law governing the processing of migrants, including deportations, asylum procedures, and penalties for unauthorized border crossings. Title 42: A public health order used during the COVID-19 pandemic to rapidly expel migrants at the border without standard immigration processing, citing health concerns.) |
|encounter_type |character |The category of encounter based on Title of Authority and component (Title 8 for USBP = Apprehensions; Title 8 for OFO = Inadmissibles; Title 42 = Expulsions) |
|encounter_count |integer |The number of individuals encountered |

# `cbp_state.csv`

|variable |class |description |
|:------------------|:---------|:-------------------------------------|
|fiscal_year |integer |The fiscal year the encounter took place |
|month_grouping |character |Allows for comparisons between completed FY months vs. those remaining |
|month_abbv |character |The month the encounter took place (abbreviated, eg "APR") |
|land_border_region |character |The border region in which the encounter occurred ("Northern Land Border", "Southwest Land Border", or "Other"); border regions are defined by each component. Nationwide numbers are calculated by adding together Northern Land Border, Southwest Land Border, and Other regions |
|state |character |State of the encounter |
|demographic |character |Categories under which individuals were encountered based on factors such as age, admissibility, and relationship (FMUA = Individuals in a Family Unit; UC = Unaccompanied Children) |
|citizenship |character |Citizenship of the individual encountered |
|title_of_authority |character |The authority under which the noncitizen was processed (Title 8: The standard U.S. immigration law governing the processing of migrants, including deportations, asylum procedures, and penalties for unauthorized border crossings. Title 42: A public health order used during the COVID-19 pandemic to rapidly expel migrants at the border without standard immigration processing, citing health concerns.) |
|encounter_count |integer |The number of individuals encountered |

### Cleaning Script

```r
library(tidyverse)
library(janitor)

cbp_resp <- bind_rows(
read_csv("https://www.cbp.gov/sites/default/files/assets/documents/2023-Nov/nationwide-encounters-fy20-fy23-aor.csv"),
read_csv("https://www.cbp.gov/sites/default/files/2024-10/nationwide-encounters-fy21-fy24-aor.csv")
) |>
janitor::clean_names() |>
unique()

cbp_state <- bind_rows(
read_csv("https://www.cbp.gov/sites/default/files/assets/documents/2023-Nov/nationwide-encounters-fy20-fy23-state.csv"),
read_csv("https://www.cbp.gov/sites/default/files/2024-10/nationwide-encounters-fy21-fy24-state.csv")
) |>
janitor::clean_names() |>
unique()
```
1 change: 1 addition & 0 deletions data/2024/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ Archive of datasets and articles from the 2024 series of `#TidyTuesday` events.
| 45 | `2024-11-05` | [Democracy and Dictatorship](2024-11-05/readme.md) | [democracyData R Package](https://xmarquez.github.io/democracyData/index.html) | [Regime types and regime change: A new dataset on democracy, coups, and political institutions](https://link.springer.com/article/10.1007/s11558-019-09345-1) |
| 46 | `2024-11-12` | [ISO Country Codes](2024-11-12/readme.md) | [ISOcodes R Package](https://cran.r-project.org/package=ISOcodes) | [ISO 3166 on Wikipedia](https://en.wikipedia.org/wiki/ISO_3166) |
| 47 | `2024-11-19` | [Bob's Burgers Episodes](2024-11-19/readme.md) | [bobsburgersR R Package](https://github.com/poncest/bobsburgersR) | [Bob’s Burgers Episode Fingerprints by Season](https://stevenponce.netlify.app/projects/standalone_visualizations/sa_2024-11-11.html) |
| 48 | `2024-11-26` | [U.S. Customs and Border Protection (CBP) Encounter Data](2024-11-26/readme.md) | [U.S. Customs and Border Protection](https://www.cbp.gov/) | [U.S. Border Patrol Encounters](https://gdatascience.github.io/us_border_patrol_encounters/us_border_patrol_encounters.html) |
2 changes: 2 additions & 0 deletions static/tt_data_type.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Week,Date,year,data_files,data_type,delim
48,2024-11-26,2024,cbp_resp.csv,csv,","
48,2024-11-26,2024,cbp_state.csv,csv,","
47,2024-11-19,2024,episode_metrics.csv,csv,","
46,2024-11-12,2024,countries.csv,csv,","
46,2024-11-12,2024,country_subdivisions.csv,csv,","
Expand Down

0 comments on commit c9b8b7e

Please sign in to comment.