forked from rfordatascience/tidytuesday
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphilly_parking.R
30 lines (19 loc) · 886 Bytes
/
philly_parking.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Load Libraries ----------------------------------------------------------
library(here)
library(tidyverse)
# Read in raw Data --------------------------------------------------------
df <- read_csv(here("2019", "2019-12-03", "parking_violations.csv"))
small_df <- df %>%
mutate(date = lubridate::date(issue_datetime),
year = lubridate::year(date)) %>%
filter(year == 2017, state == "PA") %>%
# removing date/year as duplicative
# removing state as all PA
# gps as filtering only lat/long present
# division is > 60% missing
# location as a very large amount of metadata without as much use
select(-date, -year, -gps, -location, -state, -division) %>%
filter(!is.na(lat))
pryr::object_size(small_df)
# Write to csv ------------------------------------------------------------
write_csv(small_df, here("2019", "2019-12-03", "tickets.csv"))