I’m going to try to do the 30 day map challenge. Think Inktober, but for geospatial. To keep the flow I’m likely to do minimal commentary, and a couple of days might land at once when I play catch-up.
Anyway,
#Day 1: Points
tmap_mode("view")
data_pipe = function(year_index){
data = stats19::get_stats19(year=year_index) %>%
filter(police_force == "West Yorkshire") %>%
filter(!is.na(longitude), !is.na(latitude)) %>%
select(date, accident_severity, longitude, latitude) %>%
st_as_sf(coords = c("longitude", "latitude"), crs = "WGS84")
}
map_dfr(2022:2019, data_pipe) %>%
tm_shape() + tm_dots(col = "accident_severity")