nycPostal_sf <- st_read("data/nyc/nyc_acs_tracts.shp")
## Reading layer `nyc_acs_tracts' from data source
## `/Users/ellabayer/Documents/Hunter College/DataVisR/R-spatial/data/nyc/nyc_acs_tracts.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 2166 features and 113 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: -74.25559 ymin: 40.49612 xmax: -73.70001 ymax: 40.91553
## Geodetic CRS: NAD83
nysHealthFac <- read.csv("./R-Spatial_I_Lab/NYS_Health_Facility.csv", stringsAsFactors = FALSE)
nysHealthFac %>%
tidyr::drop_na("Facility.Longitude", "Facility.Latitude") %>%
sf::st_as_sf(coords = c("Facility.Longitude", "Facility.Latitude")) %>%
st_set_crs(4326) -> nysHealthFac_sf
nysRetailFood <- read.csv("./R-Spatial_I_Lab/NYS_Retail_Food_Stores.csv", stringsAsFactors = FALSE)
nysRetailFood %>%
dplyr::filter(County == c('Bronx', 'Kings', 'New York', 'Queens', 'Richmond') ) %>%
tidyr::extract(Location, into = c('Lat', 'Long'), regex = "(\\d+.\\d+),[ ]*([-]\\d+.\\d+)") %>%
dplyr::mutate(Lat = as.numeric(Lat), Long = as.numeric(Long)) %>%
tidyr::drop_na(Lat, Long) %>%
sf::st_as_sf(coords = c('Long', 'Lat')) %>%
st_set_crs(4326) -> nysRetailFoodNYC_sf
## Warning: There was 1 warning in `dplyr::filter()`.
## ℹ In argument: `County == c("Bronx", "Kings", "New York", "Queens",
## "Richmond")`.
## Caused by warning in `County == c("Bronx", "Kings", "New York", "Queens", "Richmond")`:
## ! longer object length is not a multiple of shorter object length
mapview(nycPostal_sf)