data-raw/neighbourhoods/02-clean.R

# Clean neighbourhoods file

library(dplyr)
library(tidyr)
library(sf)
devtools::load_all()

neighbourhoods_raw <- read_latest_file(directory = here::here("data-raw", "neighbourhoods", "extract"), suffix = "-neighbourhoods.rds", fileext = "rds")

# Only keep needed columns
neighbourhoods <- neighbourhoods_raw %>%
  select(neighbourhood = AREA_NAME, geometry, id = AREA_SHORT_CODE) %>%
  mutate(id = as.numeric(id))

# Clean up neighbourhood names
neighbourhoods <- neighbourhoods %>%
  mutate(neighbourhood = clean_neighbourhood_names(neighbourhood))

# Projection is already 4326, so good to go
st_crs(neighbourhoods)

usethis::use_data(neighbourhoods, overwrite = TRUE)
purposeanalytics/lemur documentation built on Dec. 22, 2021, 10:52 a.m.