Nolan County

Setup

library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.2     ✔ readr     2.1.4
✔ forcats   1.0.0     ✔ stringr   1.5.0
✔ ggplot2   3.4.3     ✔ tibble    3.2.1
✔ lubridate 1.9.2     ✔ tidyr     1.3.0
✔ purrr     1.0.2     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(janitor)

Attaching package: 'janitor'

The following objects are masked from 'package:stats':

    chisq.test, fisher.test
library(readxl)
library(lubridate)

Import

Same process as before

nolan <- read_excel("data-raw/NolanCounty.xlsx")

nolan |> glimpse()
Rows: 38
Columns: 7
$ name           <chr> "Michael Glen Mulleneaux Jr", "Christopher Gonzalez", "…
$ age            <dbl> 33, 24, 21, 26, 18, 17, 19, 29, 25, 27, 28, 37, 24, 25,…
$ race           <chr> "W", "H", "H", "H", "W", "W", "W", "H", "W", "W", "W", …
$ sex            <chr> "M", "M", "M", "M", "M", "M", "M", "M", "F", "F", "M", …
$ date_arrest    <dttm> 2018-08-21, 2020-05-16, 2020-06-17, 2020-06-17, 2020-0…
$ charges        <chr> "Possession Marijuana > 2oz < 4oz", "Possession Marijua…
$ address_arrest <chr> "2926 N Highway 70, 79556", "CR 175 and Hwy 153, 79537"…

Clean

nolan_clean <- nolan |> cbind(datetime_arrest = NA, agency_arrest = NA, ethnicity = NA)

nolan_clean |> glimpse()
Rows: 38
Columns: 10
$ name            <chr> "Michael Glen Mulleneaux Jr", "Christopher Gonzalez", …
$ age             <dbl> 33, 24, 21, 26, 18, 17, 19, 29, 25, 27, 28, 37, 24, 25…
$ race            <chr> "W", "H", "H", "H", "W", "W", "W", "H", "W", "W", "W",…
$ sex             <chr> "M", "M", "M", "M", "M", "M", "M", "M", "F", "F", "M",…
$ date_arrest     <dttm> 2018-08-21, 2020-05-16, 2020-06-17, 2020-06-17, 2020-…
$ charges         <chr> "Possession Marijuana > 2oz < 4oz", "Possession Mariju…
$ address_arrest  <chr> "2926 N Highway 70, 79556", "CR 175 and Hwy 153, 79537…
$ datetime_arrest <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
$ agency_arrest   <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
$ ethnicity       <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…

Export

Nothing to clean, now we export.

nolan_clean |> write_csv("data-processed/Nolan-County.csv")