library(sf)
library(mapview)

Download hospitals from Homeland Infrastructure Foundation-Level Data (HIFLD)

Dataset page with metadata, API & interactive map info

# Download zipped shapefile:
utils::download.file("http://opendata.arcgis.com/agol/arcgis/6ac5e325468c4cb9b905f1728d6fbf0f/0.zip", destfile = "HIFLD_2019_Hospitals.zip")
# Unzip
utils::unzip("HIFLD_2019_Hospitals.zip")

Load shapefile into Simple Features object

hos = st_read("Hospitals.shp", quiet = TRUE)

Subset to NYC

hos_nyc = hos[hos$STATE == "NY" & hos$COUNTY %in% c('NEW YORK', 'RICHMOND', 'BRONX', 'KINGS', 'QUEENS'), ]
cat("There are", nrow(hos_nyc), "hospitals in New York City \n")
## There are 80 hospitals in New York City

Hospital names

nyc_names = as.character(hos_nyc$NAME)
sinai_names = nyc_names[grep("SINAI", nyc_names)] 
sinai_names
## [1] "MOUNT SINAI BETH ISRAEL BROOKLYN"                     
## [2] "MOUNT SINAI ST. LUKE'S"                               
## [3] "MOUNT SINAI WEST"                                     
## [4] "MOUNT SINAI HOSPITAL"                                 
## [5] "MOUNT SINAI HOSPITAL - MOUNT SINAI HOSPITAL OF QUEENS"
## [6] "MOUNT SINAI BETH ISRAEL"

SF of 6 MSH locations

Confirmed these against addresses on hospital websites

sinai_sf = hos_nyc[hos_nyc$NAME %in% sinai_names, ]
mapview(sinai_sf[, c('NAME', 'ADDRESS', 'TYPE', 'STATUS', 'BEDS', 'WEBSITE')], 
        legend = FALSE, zcol = "NAME", homebutton = FALSE)