B Data Cleaning
Anyone familiar working with ICE data knows that the agency is notorious for releasing dirty data filled with pesky errors. For example, consider the Krome Service Processing Center, the very first immigration processing center established in the 1980’s after the closure of Ellis Island in 1954. Of all the facilities the agency should name consistently, Krome the very first detention center of the contemporary system, one would expect ICE to get right. However, the facility inspections page lists the following names for the Krome Service Processing Center:
- Krome Special Processing Center (SPC) (FL) - Feb. 10, 2021
- Krome Service Procesing Center (FL) - Feb. 13, 2020
- Krome SPC (FL) - Feb. 14, 2019
Every instance is different. In one case “Special” is replaced for “Service.” In another case the word processing is misspelled “Procesing,” while in a third, the title is abbreviated. This is one example of many. In other cases facilities are sometimes named “Detention Center” rather than “Detention Facility,” etc. Assembling the data into a useful table that can be sorted, filtered, and summarized requires standardizing the names.
From early on, Craig decided to assemble the data as reported, errors and all, and perform standardization programmatically. Doing this facilitates reproducibility. The project’s primary cleaning functions are incorporated into a custom function clean_facility_names()
and moved to a separate R file. This allows more than 100 lines of code to be collapsed into a single function call. However, for display purposes, the lines of code that make up the transformations are detailed on this page.
B.1 Cleaning Script
During the time that the students were assembling data, we worked out of a Google Sheet as this permitted each of us to have simultaneous access to the data. For preliminary analysis, a data frame is constructed by reading from the sheet.
# Read in the sheet
df_inspect <- read_sheet("https://docs.google.com/spreadsheets/d/1im5VSi3bIEi13O8WQ56wEIXSyNEstbGMylXXgD9bAG0/edit#gid=1858227071",
sheet="Inspections",
col_names = TRUE,
col_types = "c") %>%
clean_names()
Sometimes facility names are repeated. Use of the dplyr
function distinct
is useful for isolating issues with field names (Wickham, François, et al. 2021).
ID | Facility |
---|---|
25 | Adams County Correctional Center (MS) - Dec. 3, 2020 |
141 | Adams County Correctional Center (MS) - Nov. 21, 2019 |
290 | Adelanto ICE Processing Center-East (CA) - Oct. 11, 2018 |
291 | Adelanto ICE Processing Center-West (CA) - Oct. 11, 2018 |
43 | Adelanto ICE Processing Center - East (CA) - Nov. 20, 2020 |
142 | Adelanto ICE Processing Center - East (CA) - Nov. 21, 2019 |
44 | Adelanto ICE Processing Center - West (CA) - Nov. 18, 2020 |
143 | Adelanto ICE Processing Center - West (CA) - Nov. 21, 2019 |
12 | Alamance County Detention Center (NC) - Jan. 8, 2021 |
375 | Alamance County Detention Center (NC) - June 17, 2021 |
144 | Alamance County Jail (NC) - Nov. 7, 2019 |
301 | Albany County Correctional Facility (NY) - Sep. 27, 2018 |
252 | Allen Parish Detention Facility (LA) - Feb. 14, 2019 |
129 | Allen Parish Public Safety Complex (LA) - Dec. 5, 2019 |
26 | Allen Parish Public Safety Complex (LA) - Dec. 9, 2020 |
322 | Atlanta City Detention Center (GA) - Jun. 21, 2018 |
14 | Aurora ICE Processing Center (CO) - Jan. 27, 2021 |
145 | Aurora ICE Processing Center (CO) - Nov. 27, 2019 |
293 | Aurora ICE Processing Center (CO) - Oct. 4, 2018 |
13 | Aurora ICE Processing Center II - Annex (CO) - Jan. 29, 2021 |
146 | Aurora ICE Processing Center II - Annex (CO) - Nov. 27, 2019 |
323 | Baker County Detention Center (FL) - Jun. 1, 2018 |
365 | Baker County Detention Center (FL) - May 20, 2021 |
227 | Baker County Detention Center (FL) - May 31, 2019 |
45 | Baker County Detention Center (FL) - Nov. 5, 2020 |
1 | Bergen County Jail (NJ) - Feb. 24, 2021 |
107 | Bergen County Jail (NJ) - Feb. 27, 2020 |
253 | Bergen County Jail (NJ) - Feb. 28, 2019 |
158 | Berks County Residential Center (PA) - Oct. 17, 2019 |
174 | Berks County Residential Center (PA) - Sep. 3, 2019 |
130 | Berks County Residential Center (TX) - Dec. 17, 2019 |
147 | Berks County Residential Center (TX) - Nov. 12, 2019 |
213 | Berks Family Residential Center (PA) - Jun. 25, 2019 |
376 | Bluebonnet Detention Center (TX) - July 1, 2021 |
60 | Bluebonnet Detention Center (TX) - Oct. 23, 2020 |
342 | Boone County Jail (KY) - Mar. 3, 2021 |
100 | Boone County Jail (KY) - Mar. 5, 2020 |
244 | Boone County Jail (KY) - Mar. 7, 2019 |
131 | Bossier Parish Corrections Center (LA) - Dec. 5, 2019 |
262 | Bossier Parish Corrections Center (LA) - Jan. 29 - 31, 2019 |
366 | Bristol County Jail (MA) - May 13, 2021 |
332 | Bristol County Jail and House of Correction (MA) - May 10, 2018 |
228 | Bristol County Jail and House of Correction (MA) - May 16, 2019 |
46 | Bristol County Jail and House of Correction (MA) - Nov. 18, 2020 |
254 | Brooks County Detention Center (TX) - Feb. 21, 2019 |
108 | Brooks County Detention Center (TX) - Feb. 21, 2020 |
159 | Broward Transitional Center (FL) - Oct. 31, 2019 |
86 | Broward Transitional Center (FL) - Sep. 24, 2020 |
235 | Buffalo (Batavia) Service Processing Center (NY) - Apr. 4, 2019 |
15 | Butler County Jail (OH) - Jan. 21, 2021 |
280 | Cache County Jail (UT) - Nov. 8, 2018 |
333 | Caldwell County Detention Center (MO) - May 24, 2018 |
101 | Calhoun County Correctional Center (MI) - Mar. 5, 2020 |
245 | Calhoun County Correctional Center (MI) - Mar. 7, 2019 |
343 | Calhoun County Jail (MI) - Mar. 3, 2021 |
148 | Cambria County Prison (PA) - Nov. 7, 2019 |
281 | Cambria County Prison (PA) - Nov. 8, 2018 |
364 | Caroline Detention Facility (VA) - Apr. 28, 2021 |
87 | Caroline Detention Facility (VA) - Sep. 17, 2020 |
132 | Carver County Jail (MN) - Dec. 5, 2019 |
302 | Cass County Jail (NE) - Sep. 13, 2018 |
175 | Cass County Jail (NE) - Sep. 19, 2019 |
187 | Catahoula Correctional Center (LA) - Aug. 22, 2019 |
61 | Catahoula Correctional Center (LA) - Nov. 9, 2020 |
47 | CCA Florence Correctional Center (AZ) - Nov. 6, 2020 |
188 | Central Arizona Florence Correctional Complex (AZ) - Aug. 29, 2019 |
307 | Central Arizona Florence Correctional Complex (AZ) - Aug. 30, 2018 |
16 | Chase County Detention Center (KS) - Jan. 27, 2021 |
200 | Chase County Detention Center (KS) - Jul. 11, 2019 |
316 | Chase County Detention Center (KS) - Jul. 12, 2018 |
344 | Chippewa County Correctional Facility (MI) - Mar. 24, 2021 |
246 | Chippewa County Correctional Facility (MI) - Mar. 29, 2019 |
17 | Christian County Jail (MO) - Jan. 13, 2021 |
334 | Christian County Jail (MO) - May 24, 2018 |
27 | Cibola County Correctional Center (NM) - Dec. 3, 2020 |
335 | Cibola County Correctional Center (NM) - May 10, 2018 |
367 | Cibola County Correctional Center (NM) - May 6, 2021 |
229 | Cibola County Correctional Center (NM) - May 9, 2019 |
324 | Clay County Jail (IN) - Jun. 1, 2018 |
230 | Clay County Jail (IN) - May 31, 2019 |
368 | Clay County Justice Center (IN) - May 20, 2021 |
62 | Clay County Justice Center (IN) - Oct. 15, 2020 |
48 | Clinton County Correctional Facility (PA) - Nov. 25, 2020 |
283 | Clinton County Correctional Facility (PA) - Nov. 8, 2018 |
176 | Clinton County Correctional Facility (PA) - Sep. 26, 2019 |
292 | Clinton County Jail (NY) - Oct. 25, 2018 |
118 | Coastal Bend Detention Center (TX) - Jan. 9, 2020 |
263 | Coastal Bend Detention Facility (TX) - Jan. 10, 2019 |
345 | David L. Moss Criminal Justice Center (OK) - Mar. 12, 2021 |
119 | DeKalb County Detention Facility (GA) - Jan. 30, 2020 |
346 | Desert View Annex (CA) - Mar. 24, 2021 |
63 | Desert View Annex (CA) - Oct. 29, 2020 |
359 | Dodge County Detention Center (WI) - Apr. 16, 2021 |
236 | Dodge County Detention Facility (WI) - Apr. 18, 2019 |
64 | Dodge County Detention Facility (AK) - Oct. 29, 2020 |
49 | Donald W. Wyatt Detention Center (RI) - Nov. 18, 2020 |
243 | Donald W. Wyatt Detention Facility (RI) - Apr. 11, 2019 |
356 | Donald W. Wyatt Detention Facility (RI) - Apr. 8, 2021 |
102 | Dorchester County Detention Center (MD) - Mar. 19, 2020 |
347 | Dorchester County Detention Center (MD) - Mar. 24, 2021 |
348 | Dorchester County Detention Center (SC) - Mar. 17, 2021 |
160 | Douglas County Department of Corrections (NE) - Oct. 24, 2019 |
294 | Douglas County Department of Corrections (NE) - Oct. 25, 2018 |
317 | East Hidalgo Detention Center (TX) - Jul. 26, 2018 |
65 | East Hidalgo Detention Center (TX) - Oct. 3, 2020 |
177 | East Hidalgo Detention Center (TX) - Sep. 6, 2019 |
28 | Eden Detention Center (TX) - Dec. 3, 2020 |
133 | El Paso Service Processing Center (TX) - Dec. 12, 2019 |
271 | El Paso Service Processing Center (TX) - Dec. 13, 2018 |
29 | El Paso Service Processing Center (TX) - Dec. 3, 2020 |
30 | El Valle Detention Facility (TX) - Dec. 10, 2020 |
272 | El Valle Detention Facility (TX) - Dec. 6, 2018 |
161 | El Valle Detention Facility (TX) - Oct. 24, 2019 |
295 | Elizabeth Contract Detention Facility (NJ) - Oct. 12, 2018 |
162 | Elizabeth Contract Detention Facility (NJ) - Oct. 3, 2019 |
88 | Elizabeth Contract Detention Facility (NJ) - Sep. 17, 2020 |
2 | Eloy Detention Center (AZ) - Feb. 5, 2021 |
109 | Eloy Detention Center (AZ) - Feb. 6, 2020 |
255 | Eloy Detention Center (AZ) - Feb. 7, 2019 |
303 | Essex County Correctional Facility (NJ) - Sep. 27, 2018 |
66 | Essex County Correctional Facility (NJ) - Oct. 9, 2020 |
178 | Essex County Corrections Facility (NJ) - Sep. 26, 2019 |
201 | Etowah County Jail (AL) - Jul. 18, 2019 |
318 | Etowah County Jail (AL) - Jul. 19, 2018 |
67 | Etowah County Jail (AL) - Oct. 23, 2020 |
110 | Farmville Detention Center (CA) - Feb. 27, 2020 |
237 | Florence Service Processing Center (AZ) - Apr. 11, 2019 |
357 | Florence Service Processing Center (AZ) - Apr. 8, 2021 |
50 | Florence SPC (AZ) - Nov. 4, 2020 |
214 | Folkston ICE Processing Center (GA) - Jun. 6, 2019 |
215 | Folkston ICE Processing Center Annex (GA) - Jun. 6, 2019 |
68 | Folkston ICE Processing Center Annex (GA) - Oct. 9, 2020 |
69 | Folkston ICE Processing Center (GA) - Oct. 7, 2020 |
202 | Frederick County Detention Center (MD) - Jul. 11, 2019 |
360 | Freeborn County Adult Detention Center (MN) - Apr. 16, 2021 |
238 | Freeborn County Adult Detention Center (MN) - Apr. 18, 2019 |
89 | Freeborn County Adult Detention Center (MN) - Sep. 10, 2020 |
31 | Geauga County Jail (OH) - Dec. 10, 2020 |
284 | Geauga County Jail (OH) - Nov. 29, 2018 |
163 | Geauga County Jail (OH) - Oct. 10, 2019 |
3 | Glades County Detention Center (FL) - Feb. 24, 2021 |
247 | Glades County Detention Center (FL) - Mar. 14, 2019 |
103 | Glades County Detention Center (FL) - Mar. 5, 2020 |
349 | Golden State Annex (CA) - Mar. 17, 2021 |
70 | Golden State Annex (CA) - Oct. 16, 2020 |
336 | Grand Forks County Correctional Facility (ND) - May 17, 2018 |
203 | Hall County Department of Corrections (NE) - Jul. 11, 2019 |
319 | Hall County Department of Corrections (NE) - Jul. 12, 2018 |
90 | Hall County Department of Corrections (NE) - Sep. 17, 2020 |
51 | Hardin County Jail (IA) - Nov. 11, 2020 |
179 | Hardin County Jail (IA) - Sep. 12, 2019 |
304 | Hardin County Jail (IA) - Sep. 13, 2018 |
204 | Henderson Detention Center (NV) - Jul. 18, 2019 |
320 | Henderson Detention Center (NV) - Jul. 19, 2018 |
52 | Henderson Detention Center (NV) - Nov. 20, 2020 |
120 | Houston CDF (TX) - Jan. 9, 2020 |
264 | Houston Contract Detention Facility (TX) - Jan. 10, 2019 |
18 | Houston Contract Detention Facility (TX) - Jan. 6, 2021 |
189 | Howard County Detention Center (MD) - Aug. 29, 2019 |
32 | Howard County Detention Center (MD) - Dec. 9, 2020 |
285 | Howard County Detention Center (MD) - Nov. 29, 2018 |
369 | Hudson County Corrections and Rehabilitation Center (NJ) - May 6, 2021 |
231 | Hudson County Corrections and Rehabilitation Center (NJ) - May 9, 2019 |
71 | Hudson County Corrections and Rehabilitation Center (NJ) - Oct. 7, 2020 |
265 | IAH Secure Adult Detention Facility (Polk) (TX) - Jan. 10, 2019 |
256 | Immigration Centers of America - Farmville (VA) - Feb. 28, 2019 |
4 | Immigration Centers of America (ICA) - Farmville Detention Center (FDC) (VA) - Feb. 24, 2021 |
19 | Imperial Regional Detention Facility (CA) - Jan. 13, 2021 |
121 | Imperial Regional Detention Facility (CA) - Jan. 16, 2020 |
266 | Imperial Regional Detention Facility (CA) - Jan. 17, 2019 |
216 | Irwin County Detention Center (GA) - Jun. 13, 2019 |
325 | Irwin County Detention Center (GA) - Jun. 14, 2018 |
91 | Irwin County Detention Center (GA) - Sep. 25, 2020 |
53 | Jackson Parish Correctional Center (LA) - Nov. 20, 2020 |
149 | Jackson Parish Correctional Center (LA) - Nov. 7, 2019 |
297 | James A. Musick Facility (CA) - Oct. 18, 2018 |
72 | Jena LaSalle Detention Facility (LA) - Oct. 7, 2020 |
239 | Jerome Combs Detention Center (IL) - Apr. 11, 2019 |
355 | Jerome Combs Detention Center (IL) - Apr. 7, 2021 |
54 | Jerome Combs Detention Center (IL) - Nov. 25, 2020 |
150 | Joe Corley Detention Facility (TX) - Nov. 15, 2019 |
286 | Joe Corley Detention Facility (TX) - Nov. 16, 2018 |
33 | Joe Corley Processing Center (TX) - Dec. 18, 2020 |
190 | Johnson County Corrections Center (TX) - Aug. 22, 2019 |
308 | Johnson County Corrections Center (TX) - Aug. 23, 2018 |
92 | Johnson County Corrections Center (TX) - Sep. 17, 2020 |
273 | Kandiyohi County Jail (MN) - Dec. 6, 2018 |
205 | Kandiyohi County Jail (MN) - Jul. 11, 2019 |
377 | Kandiyohi County Jail (MN) - July 1, 2021 |
134 | Karnes County Family Residential Center (TX) - Dec. 3, 2019 |
191 | Karnes County Residential Center (TX) - Aug. 15, 2019 |
135 | Karnes County Residential Center (TX) - Dec. 5, 2019 |
111 | Karnes County Residential Center (TX) - Feb. 25, 2020 |
122 | Karnes County Residential Center (TX) - Jan. 21, 2020 |
206 | Karnes County Residential Center (TX) - Jul. 30, 2019 |
217 | Karnes County Residential Center (TX) - Jun. 11, 2019 |
151 | Karnes County Residential Center (TX) - Nov. 6, 2019 |
180 | Karnes County Residential Center (TX) - Sep. 25, 2019 |
164 | Kay County Detention Center (OK) - Oct. 24, 2019 |
73 | Kay County Detention Center (OK) - Oct. 15, 2020 |
218 | Kenosha County Detention Center (WI) - Jun. 6, 2019 |
326 | Kenosha County Detention Center (WI) - Jun. 7, 2018 |
370 | Krome North Service Processing Center (FL) - May 13, 2021 |
112 | Krome Service Procesing Center (FL) - Feb. 13, 2020 |
257 | Krome SPC (FL) - Feb. 14, 2019 |
5 | Krome Special Processing Center (SPC) (FL) - Feb. 10, 2021 |
219 | La Palma Correctional Center (AZ) - Jun. 27, 2019 |
378 | La Palma Correctional Center (AZ) - June 24, 2021 |
55 | La Palma Correctional Center (AZ) - Nov. 5, 2020 |
220 | Laredo Processing Center (TX) - Jun. 6, 2019 |
327 | Laredo Processing Center (TX) - Jun. 7, 2018 |
371 | Laredo Processing Center (TX) - May 27, 2021 |
74 | Laredo Processing Center (TX) - Oct. 23, 2020 |
152 | LaSalle Correctional Center (LA) - Nov. 15, 2019 |
75 | LaSalle County Regional Detention Center (TX) - Oct. 21, 2020 |
181 | LaSalle ICE Processing Center (LA) - Sep. 26, 2019 |
305 | LaSalle ICE Processing Center (LA) - Sep. 27, 2018 |
93 | Limestone County Detention Center (TX) - Oct. 1, 2020 |
165 | Limestone County Detention Center (TX) - Oct. 24, 2019 |
221 | Linn County Correctional Center (IA) - Jun. 20, 2019 |
296 | Marshall County Jail (IA) - Oct. 25, 2018 |
379 | McHenry County Adult Correction Facility (IL) - June 10, 2021 |
222 | McHenry County Adult Correctional Facility (IL) - Jun. 13, 2019 |
328 | McHenry County Adult Correctional Facility (IL) - Jun. 14, 2018 |
94 | McHenry County Adult Correctional Facility (IL) - Oct. 1, 2020 |
223 | Mesa Verde Detention Facility (CA) - Jun. 27, 2019 |
329 | Mesa Verde Detention Facility (CA) - Jun. 28, 2018 |
380 | Mesa Verde Detention Facility (CA) - June 24, 2021 |
76 | Mesa Verde ICE Processing Facility (CA) - Oct. 14, 2020 |
309 | Monroe County Detention Center (FL) - Aug. 23, 2018 |
192 | Monroe County Inmate Dormitory (MI) - Aug. 15, 2019 |
310 | Monroe County Inmate Dormitory (MI) - Aug. 16, 2018 |
34 | Monroe County Inmate Dormitory (MI) - Dec. 30, 2020 |
207 | Monroe County Jail (FL) - Aug. 1, 2019 |
153 | Montgomery County Jail (MO) - Nov. 7, 2019 |
35 | Montgomery Processing Center (TX) - Dec. 16, 2020 |
136 | Montgomery Processing Center (TX) - Dec. 19, 2019 |
275 | Montgomery Processing Center (TX) - Dec. 20, 2018 |
274 | Morgan County Adult Detention Center (MO) - Dec. 6, 2018 |
258 | Morgan County Adult Detention Center (MO) - Feb. 21, 2019 |
56 | Morgan County Adult Detention Center (MO) - Nov. 11, 2020 |
6 | Morrow County Correctional Facility (OH) - Feb. 10, 2021 |
208 | Natchitoches Parish Detention Center (LA) - Jul. 3, 2019 |
209 | Nevada Southern Detention Center (NV) - Jul. 25, 2019 |
321 | Nevada Southern Detention Center (NV) - Jul. 26, 2018 |
337 | Nobles County Jail (MN) - May 24, 2018 |
248 | Northeast Ohio Correctional Center (OH) - Mar. 21, 2019 |
276 | Northern Oregon Correctional Facility (OR) - Dec. 13, 2018 |
166 | Northern Oregon Correctional Facility (OR) - Oct. 31, 2019 |
36 | Northwest Contract Detention Center (WA) - Dec. 17, 2020 |
232 | Northwest Detention Center (WA) - May 16, 2019 |
372 | Northwest ICE Processing Center (WA) - May 13, 2021 |
373 | Nye County Detention Center (NV) - May 20, 2021 |
57 | Nye County Detention Center (NV) - Nov. 4, 2020 |
182 | Okmulgee County Jail-Moore Detention Facility (OK) - Sep. 19, 2019 |
95 | Okmulgee County Jail - Moore Detention Facility (OK) - Oct. 1, 2020 |
298 | Okmulgee County Jail - Moore Detention Facility (OK) - Oct. 4, 2018 |
358 | Orange County Correctional Facility (NY) - Apr. 14, 2021 |
240 | Orange County Jail (NY) - Apr. 18, 2019 |
77 | Orange County Jail (NY) - Oct. 30, 2020 |
267 | Otay Mesa Detention Center (CA) - Jan. 25, 2019 |
7 | Otay Mesa Detention Facility (CA) - Feb. 3, 2021 |
123 | Otay Mesa Detention Facility (CA) - Jan. 24, 2020 |
20 | Otero County Processing Center (NM) - Jan. 29, 2021 |
124 | Otero County Processing Center (NM) - Jan. 30, 2020 |
268 | Otero County Processing Center (NM) - Jan. 31, 2019 |
210 | Phelps County Jail (NE) - Jul. 18, 2019 |
361 | Pike County Correctional Facility (PA) - Apr. 21, 2021 |
241 | Pike County Correctional Facility (PA) - Apr. 25, 2019 |
78 | Pike County Correctional Facility (PA) - Oct. 28, 2020 |
362 | Pine Prairie ICE Processing Center (LA) - Apr. 21, 2021 |
242 | Pine Prairie ICE Processing Center (LA) - Apr. 25, 2019 |
58 | Pine Prairie ICE Processing Center (LA) - Nov. 5, 2020 |
137 | Platte County Detention Center (MO) - Dec. 12, 2019 |
381 | Plymouth County Correction Facility (MA) - June 10, 2021 |
37 | Plymouth County Correctional Facility (MA) - Dec. 30, 2020 |
224 | Plymouth County Correctional Facility (MA) - Jun. 13, 2019 |
330 | Plymouth County Correctional Facility (MA) - Jun. 14, 2018 |
21 | Polk County Adult Detention Center (TX) - Jan. 6, 2021 |
125 | Polk County Adult Detention Center (TX) - Jan. 9, 2020 |
211 | Polk County Jail (IA) - Aug. 1, 2019 |
311 | Polk County Jail (IA) - Aug. 2, 2018 |
22 | Port Isabel Service Processing Center (TX) - Jan. 27, 2021 |
126 | Port Isabel Service Processing Center (TX) - Jan. 30, 2020 |
269 | Port Isabel Service Processing Center (TX) - Jan. 31, 2019 |
113 | Prairieland Detention Center (TX) - Feb. 13, 2020 |
259 | Prairieland Detention Center (TX) - Feb. 14, 2019 |
8 | Prarieland Detention Center (TX) - Feb. 10, 2021 |
382 | Pulaski County Detention Center (IL) - June 17, 2021 |
350 | Pulaski County Detention Center (IL) - Mar. 10, 2021 |
104 | Pulaski County Detention Center (IL) - Mar. 12, 2020 |
249 | Pulaski County Detention Center (IL) - Mar. 14, 2019 |
79 | Richwood Correcrtional Center (LA) - Oct. 21, 2020 |
168 | Richwood Correctional Center (LA) - Oct. 3, 2019 |
250 | Rio Grande Detention Center (TX) - Mar. 14, 2019 |
351 | Rio Grande Processing Center (TX) - Mar. 10, 2021 |
105 | Rio Grande Processing Center (TX) - Mar. 12, 2020 |
277 | River Correctional Center (LA) - Dec. 6, 2018 |
106 | River Correctional Center (LA) - Mar. 12, 2020 |
352 | River Correctional Center (LA) - Mar. 17, 2021 |
167 | River Correctional Center (LA) - Oct. 24, 2019 |
138 | Robert A. Deyton Correctional Center (GA) - Dec. 5, 2019 |
38 | Robert A. Deyton Detention Center (GA) - Dec. 17, 2020 |
193 | Rolling Plains Detention Center (TX) - Aug. 8, 2019 |
80 | Rolling Plains Detention Center (TX) - Oct. 21, 2020 |
96 | Saint Clair County Jail (MI) - Oct. 1, 2020 |
363 | San Luis Regional Detention Center (AZ) - Apr. 28, 2021 |
341 | San Luis Regional Detention Center (AZ) - May 3, 2018 |
59 | San Luis Regional Detention Center (AZ) - Nov. 25, 2020 |
23 | Seneca County Jail (OH) - Jan. 13, 2021 |
169 | Seneca County Jail (OH) - Oct. 3, 2019 |
299 | Seneca County Jail (OH) - Oct. 4, 2018 |
183 | Shawnee County Department of Corrections - Adult Detention Center (KS) - Sep. 6, 2019 |
24 | Sherburne County Jail (MN) - Jan. 21, 2021 |
154 | Sherburne County Jail (MN) - Nov. 15, 2019 |
287 | Sherburne County Jail (MN) - Nov. 16, 2018 |
139 | Sheriff Al Cannon Detention Center (SC) - Dec. 12, 2019 |
282 | Sheriff Al Cannon Detention Center (SC) - Nov. 29, 2018 |
39 | South Louisiana ICE Processing Center (LA) - Dec. 11, 2020 |
155 | South Louisiana ICE Processing Center (LA) - Nov. 7, 2019 |
260 | South Texas Detention Complex (TX) - Feb. 28, 2019 |
194 | South Texas Family Residential Center (TX) - Aug. 19, 2019 |
114 | South Texas Family Residential Center (TX) - Feb. 12, 2020 |
127 | South Texas Family Residential Center (TX) - Jan. 7, 2020 |
212 | South Texas Family Residential Center (TX) - Jul. 30, 2019 |
226 | South Texas Family Residential Center (TX) - Jun. 25, 2019 |
156 | South Texas Family Residential Center (TX) - Nov. 12, 2019 |
170 | South Texas Family Residential Center (TX) - Oct. 31, 2019 |
115 | South Texas ICE Processing Center (TX) - Feb. 27, 2020 |
9 | South Texas Processing Center (TX) - Feb. 26, 2021 |
312 | St. Clair County Jail (MI) - Aug. 9, 2018 |
225 | St. Clair County Jail (MI) - Jun. 20, 2019 |
338 | Stewart Detention Center (GA) - May 3, 2018 |
374 | Stewart Detention Center (GA) - May 6, 2021 |
233 | Stewart Detention Center (GA) - May 9, 2019 |
97 | Stewart Detention Center (GA) - Sep. 24, 2020 |
40 | Strafford County Corrections (NH) - Dec. 10, 2020 |
140 | Strafford County Corrections (NH) - Dec. 12, 2019 |
278 | Strafford County Department of Corrections (DE) - Dec. 13, 2018 |
234 | Suffolk County House of Correction (MA) - May 16, 2019 |
339 | Suffolk County House of Correction (MA) - May 3, 2018 |
353 | T. Don Hutto Detention Center (TX) - Mar. 31, 2021 |
184 | T. Don Hutto Residential Center (TX) - Sep. 12, 2019 |
196 | T. Don Hutto Residential Center (TX) - Aug. 27, 2019 |
195 | Tallahatchie County Correctional Facility (MS) - Aug. 15, 2019 |
354 | Teller County Jail (CO)- Mar. 31, 2021 |
197 | Teller County Jail (CO) - Aug. 22, 2019 |
81 | Teller County Jail (CO) - Oct. 29, 2020 |
288 | Theo Lacy Facility (CA) - Nov. 8, 2018 |
98 | Torrance County Detention Facility (NM) - Oct. 1, 2020 |
116 | Tulsa County Jail - David L. Moss Criminal Jutice Center (OK) - Feb. 21, 2020 |
251 | Tulsa County Jail (David L. Moss Criminal Justice Center) (OK) - Mar. 14, 2019 |
270 | Tulsa County Jail (David L. Moss Justice Center) (OK) - Jan. 25, 2019 |
331 | Tulsa County Jail (OK) - Jun. 1, 2018 |
185 | Val Verde Correctional Facility (TX) - Sep. 19, 2019 |
340 | Virginia Peninsula Regional Jail (VA) - May 17, 2018 |
279 | Wakulla County Detention Facility (FL) - Dec. 13, 2018 |
171 | Wakulla County Detention Facility (FL) - Oct. 18, 2019 |
82 | Wakulla County Detention Facility (FL) - Oct. 8, 2020 |
313 | Washoe County Detention Center (NV) - Aug. 30, 2018 |
83 | Washoe County Detention Centerr (NV) - Oct. 15, 2020 |
10 | Webb County Detention Center (TX) - Feb. 3, 2021 |
261 | Webb County Detention Center (TX) - Feb. 7, 2019 |
117 | Webb County Detention Facility (TX) - Feb. 6, 2020 |
198 | West Texas Detention Facility (TX) - Aug. 8, 2019 |
314 | West Texas Detention Facility (TX) - Aug. 9, 2018 |
99 | West Texas Detention Facility (TX) - Sep. 29, 2020 |
128 | Western Tennessee Detention Facility (TN) - Jan. 16, 2020 |
186 | Willacy County Regional Detention Facility (TX) - Sep. 12, 2019 |
306 | Willacy County Regional Detention Facility (TX) - Sep. 13, 2018 |
84 | Willacy County Regional Detention Facility (TX) - Oct. 7, 2020 |
172 | Winn Correctional Center (LA) - Oct. 10, 2019 |
85 | Winn Correctional Center (LA) - Oct. 19, 2020 |
199 | Worcester County Jail (MD) - Aug. 15, 2019 |
315 | Worcester County Jail (MD) - Aug. 16, 2018 |
11 | Worcester County Jail (MD) - Feb. 3, 2021 |
41 | York County Prison (PA) - Dec. 11, 2020 |
300 | York County Prison (PA) - Oct. 18, 2018 |
173 | York County Prison (PA) - Oct. 18, 2019 |
42 | Yuba County Jail (CA) - Dec. 30, 2020 |
157 | Yuba County Jail (CA) - Nov. 15, 2019 |
289 | Yuba County Jail (CA) - Nov. 16, 2018 |
The following procedures detail the main facility name cleaning operations. This block of code was converted to a custom function and written to an R file. By doing this, the entire following code block can be called with a single function, or incorporated into an analysis specific pipeline. The cleaning procedures are provided here to show the transformations, but the separate function file can be downloaded directly. Heavy use is made of the dplyr
library (Wickham, François, et al. 2021) mutate
function in combination with the stringr
library (Wickham 2019) functions str_replace_all
and replace
functions. All of these are part of the tidyverse
(Wickham 2021) family of libraries.
df_inspect <- df_inspect %>%
# Removing a curious whitespace character that appears
# in more recent facility names
mutate(facility = str_replace_all(facility,
pattern = " ",
replacement = " ")) %>%
separate(.,
col = facility,
into = c("facility","inspection_date"),
sep = "\\) - ") %>%
separate(.,
col = facility,
into = c("facility","state"),
sep = "\\(") %>%
# Deal with issues in the file names, state, and inspection date
mutate(facility = str_trim(facility, side = "both"),
state = str_trim(state, side = "both"),
facility = str_replace_all(facility,
pattern = "^Adelanto ICE Processing Center-East",
replacement = "Adelanto ICE Processing Center - East"),
facility = str_replace_all(facility,
pattern = "^Adelanto ICE Processing Center-West",
replacement = "Adelanto ICE Processing Center - West"),
facility = str_replace_all(facility,
pattern = "^Allen Parish Detention Facility",
replacement = "Allen Parish Public Safety Complex"),
facility = str_replace_all(facility,
pattern = "^Berks County Residential Center",
replacement = "Berks Family Residential Center"),
inspection_date = replace(inspection_date, inspection_date=="Jan. 29 - 31, 2019", "Jan. 31, 2019"),
facility = str_replace_all(facility,
pattern = "^Bristol County Jail$",
replacement = "Bristol County Jail and House of Correction"),
facility = str_replace_all(facility,
pattern = "^Buffalo$",
replacement = "Buffalo Batavia Service Processing Center"),
state = replace(state, state == "Batavia) Service Processing Center", "NY"),
facility = str_replace_all(facility,
pattern = "^Calhoun County Jail",
replacement = "Calhoun County Correctional Center"),
facility = str_replace_all(facility,
pattern = "^Clay County Justice Center",
replacement = "Clay County Jail"),
facility = str_replace_all(facility,
pattern = "^Coastal Bend Detention Facility",
replacement = "Coastal Bend Detention Center"),
state = replace(state, state == "David L. Moss Criminal Justice Center)", "OK"),
facility = str_replace_all(facility,
pattern = "^Dodge County Detention Center",
replacement = "Dodge County Detention Facility"),
facility = str_replace_all(facility,
pattern = "^Donald W. Wyatt Detention Center",
replacement = "Donald W. Wyatt Detention Facility"),
facility = str_replace_all(facility,
pattern = "^Essex County Corrections Facility",
replacement = "Essex County Correctional Facility"),
facility = str_replace_all(facility,
pattern = "^Farmville Detention Center$",
replacement = "Immigration Centers of America - Farmville"),
facility = str_replace_all(facility,
pattern = "^Florence SPC",
replacement = "Florence Service Processing Center"),
facility = str_replace_all(facility,
pattern = "^Houston CDF",
replacement = "Houston Contract Detention Facility"),
state = replace(state, state == "Polk)", "TX"),
facility = str_replace_all(facility,
pattern = "^Immigration Centers of America$",
replacement = "Immigration Centers of America - Farmville"),
state = replace(state, state =="ICA", "VA"),
inspection_date = replace(inspection_date,
inspection_date == "Farmville Detention Center (FDC) (VA",
"Feb. 24, 2021"),
# This one picks a value in the facility col and changes a value in the state col
state = replace(state, facility == "Immigration Centers of America - Farmville",
"VA"),
facility = str_replace_all(facility,
pattern = "^Joe Corley Detention Facility",
replacement = "Joe Corley Processing Center"),
facility = str_replace_all(facility,
pattern = "^Karnes County Residential Center",
replacement = "Karnes County Family Residential Center"),
facility = str_replace_all(facility,
pattern = "^Krome SPC",
replacement = "Krome Service Procesing Center"),
facility = str_replace_all(facility,
pattern = "^Krome Special Processing Center",
replacement = "Krome Service Procesing Center"),
state = replace(state, state =="SPC)", "FL"),
facility = str_replace_all(facility,
pattern = "^Mesa Verde Detention Facility",
replacement = "Mesa Verde ICE Processing Facility"),
facility = str_replace_all(facility,
pattern = "^Northwest Contract Detention Center",
replacement = "Northwest ICE Processing Center"),
facility = str_replace_all(facility,
pattern = "^Northwest Detention Center",
replacement = "Northwest ICE Processing Center"),
facility = str_replace_all(facility,
pattern = "^Okmulgee County Jail-Moore Detention Facility",
replacement = "Okmulgee County Jail - Moore Detention Facility"),
facility = str_replace_all(facility,
pattern = "^Orange County Jail",
replacement = "Orange County Correctional Facility"),
facility = str_replace_all(facility,
pattern = "^Otay Mesa Detention Facility",
replacement = "Otay Mesa Detention Center"),
facility = str_replace_all(facility,
pattern = "^Prarieland Detention Center",
replacement = "Prairieland Detention Center"),
facility = str_replace_all(facility,
pattern = "^Richwood Correcrtional Center",
replacement = "Richwood Correctional Center"),
facility = str_replace_all(facility,
pattern = "^Rio Grande Processing Center",
replacement = "Rio Grande Detention Center"),
facility = str_replace_all(facility,
pattern = "^Robert A. Deyton Correctional Center",
replacement = "Robert A. Deyton Detention Facility"),
facility = str_replace_all(facility,
pattern = "^Robert A. Deyton Detention Center",
replacement = "Robert A. Deyton Detention Facility"),
facility = str_replace_all(facility,
pattern = "^South Texas Detention Complex",
replacement = "South Texas ICE Processing Center"),
facility = str_replace_all(facility,
pattern = "^South Texas Processing Center",
replacement = "South Texas ICE Processing Center"),
facility = str_replace_all(facility,
pattern = "^Strafford County Corrections",
replacement = "Strafford County Department of Corrections"),
inspection_date = replace(inspection_date, state =="CO)- Mar. 31, 2021", "Mar. 31, 2021"),
state = replace(state, state == "CO)- Mar. 31, 2021", "CO"),
facility = str_replace_all(facility,
pattern = "^T. Don Hutto Detention Center$",
replacement = "T. Don Hutto Residential Center"),
facility = str_replace_all(facility,
pattern = "Tulsa County Jail - David L. Moss Criminal Jutice Center",
replacement = "David L. Moss Criminal Justice Center"),
facility = str_replace_all(facility,
pattern = "^Tulsa County Jail$",
replacement = "David L. Moss Criminal Justice Center"),
state = replace(state, state == "David L. Moss Justice Center)", "OK"),
facility = str_replace_all(facility,
pattern = "^Washoe County Detention Centerr",
replacement = "Washoe County Detention Center"),
facility = str_replace_all(facility,
pattern = "^Webb County Detention Facility",
replacement = "Webb County Detention Center"),
)
ID | Facility |
---|---|
25 | Adams County Correctional Center |
43 | Adelanto ICE Processing Center - East |
44 | Adelanto ICE Processing Center - West |
12 | Alamance County Detention Center |
144 | Alamance County Jail |
301 | Albany County Correctional Facility |
26 | Allen Parish Public Safety Complex |
322 | Atlanta City Detention Center |
14 | Aurora ICE Processing Center |
13 | Aurora ICE Processing Center II - Annex |
45 | Baker County Detention Center |
1 | Bergen County Jail |
130 | Berks Family Residential Center |
60 | Bluebonnet Detention Center |
100 | Boone County Jail |
131 | Bossier Parish Corrections Center |
46 | Bristol County Jail and House of Correction |
108 | Brooks County Detention Center |
86 | Broward Transitional Center |
235 | Buffalo Batavia Service Processing Center |
15 | Butler County Jail |
280 | Cache County Jail |
333 | Caldwell County Detention Center |
101 | Calhoun County Correctional Center |
148 | Cambria County Prison |
87 | Caroline Detention Facility |
132 | Carver County Jail |
175 | Cass County Jail |
61 | Catahoula Correctional Center |
47 | CCA Florence Correctional Center |
188 | Central Arizona Florence Correctional Complex |
16 | Chase County Detention Center |
246 | Chippewa County Correctional Facility |
17 | Christian County Jail |
27 | Cibola County Correctional Center |
62 | Clay County Jail |
48 | Clinton County Correctional Facility |
292 | Clinton County Jail |
118 | Coastal Bend Detention Center |
116 | David L. Moss Criminal Justice Center |
119 | DeKalb County Detention Facility |
63 | Desert View Annex |
64 | Dodge County Detention Facility |
49 | Donald W. Wyatt Detention Facility |
102 | Dorchester County Detention Center |
160 | Douglas County Department of Corrections |
65 | East Hidalgo Detention Center |
28 | Eden Detention Center |
29 | El Paso Service Processing Center |
30 | El Valle Detention Facility |
88 | Elizabeth Contract Detention Facility |
2 | Eloy Detention Center |
66 | Essex County Correctional Facility |
67 | Etowah County Jail |
50 | Florence Service Processing Center |
69 | Folkston ICE Processing Center |
68 | Folkston ICE Processing Center Annex |
202 | Frederick County Detention Center |
89 | Freeborn County Adult Detention Center |
31 | Geauga County Jail |
3 | Glades County Detention Center |
70 | Golden State Annex |
336 | Grand Forks County Correctional Facility |
90 | Hall County Department of Corrections |
51 | Hardin County Jail |
52 | Henderson Detention Center |
18 | Houston Contract Detention Facility |
32 | Howard County Detention Center |
71 | Hudson County Corrections and Rehabilitation Center |
265 | IAH Secure Adult Detention Facility |
4 | Immigration Centers of America - Farmville |
19 | Imperial Regional Detention Facility |
91 | Irwin County Detention Center |
53 | Jackson Parish Correctional Center |
297 | James A. Musick Facility |
72 | Jena LaSalle Detention Facility |
54 | Jerome Combs Detention Center |
33 | Joe Corley Processing Center |
92 | Johnson County Corrections Center |
205 | Kandiyohi County Jail |
111 | Karnes County Family Residential Center |
73 | Kay County Detention Center |
218 | Kenosha County Detention Center |
370 | Krome North Service Processing Center |
5 | Krome Service Procesing Center |
55 | La Palma Correctional Center |
74 | Laredo Processing Center |
152 | LaSalle Correctional Center |
75 | LaSalle County Regional Detention Center |
181 | LaSalle ICE Processing Center |
93 | Limestone County Detention Center |
221 | Linn County Correctional Center |
296 | Marshall County Jail |
379 | McHenry County Adult Correction Facility |
94 | McHenry County Adult Correctional Facility |
76 | Mesa Verde ICE Processing Facility |
309 | Monroe County Detention Center |
34 | Monroe County Inmate Dormitory |
207 | Monroe County Jail |
153 | Montgomery County Jail |
35 | Montgomery Processing Center |
56 | Morgan County Adult Detention Center |
6 | Morrow County Correctional Facility |
208 | Natchitoches Parish Detention Center |
209 | Nevada Southern Detention Center |
337 | Nobles County Jail |
248 | Northeast Ohio Correctional Center |
166 | Northern Oregon Correctional Facility |
36 | Northwest ICE Processing Center |
57 | Nye County Detention Center |
95 | Okmulgee County Jail - Moore Detention Facility |
77 | Orange County Correctional Facility |
7 | Otay Mesa Detention Center |
20 | Otero County Processing Center |
210 | Phelps County Jail |
78 | Pike County Correctional Facility |
58 | Pine Prairie ICE Processing Center |
137 | Platte County Detention Center |
381 | Plymouth County Correction Facility |
37 | Plymouth County Correctional Facility |
21 | Polk County Adult Detention Center |
211 | Polk County Jail |
22 | Port Isabel Service Processing Center |
8 | Prairieland Detention Center |
104 | Pulaski County Detention Center |
79 | Richwood Correctional Center |
105 | Rio Grande Detention Center |
106 | River Correctional Center |
38 | Robert A. Deyton Detention Facility |
80 | Rolling Plains Detention Center |
96 | Saint Clair County Jail |
59 | San Luis Regional Detention Center |
23 | Seneca County Jail |
183 | Shawnee County Department of Corrections - Adult Detention Center |
24 | Sherburne County Jail |
139 | Sheriff Al Cannon Detention Center |
39 | South Louisiana ICE Processing Center |
114 | South Texas Family Residential Center |
9 | South Texas ICE Processing Center |
225 | St. Clair County Jail |
97 | Stewart Detention Center |
40 | Strafford County Department of Corrections |
234 | Suffolk County House of Correction |
184 | T. Don Hutto Residential Center |
195 | Tallahatchie County Correctional Facility |
81 | Teller County Jail |
288 | Theo Lacy Facility |
98 | Torrance County Detention Facility |
185 | Val Verde Correctional Facility |
340 | Virginia Peninsula Regional Jail |
82 | Wakulla County Detention Facility |
83 | Washoe County Detention Center |
10 | Webb County Detention Center |
99 | West Texas Detention Facility |
128 | Western Tennessee Detention Facility |
84 | Willacy County Regional Detention Facility |
85 | Winn Correctional Center |
11 | Worcester County Jail |
41 | York County Prison |
42 | Yuba County Jail |