DOH Data

Harold Nelson

10/21/2021

Setup

Get County Borders

load("counties_us.Rdata")
str(counties_us)
## Classes 'sf' and 'data.frame':   3108 obs. of  10 variables:
##  $ STATEFP : chr  "24" "31" "37" "46" ...
##  $ COUNTYFP: chr  "510" "169" "077" "091" ...
##  $ COUNTYNS: chr  "01702381" "00835906" "01008556" "01265759" ...
##  $ AFFGEOID: chr  "0500000US24510" "0500000US31169" "0500000US37077" "0500000US46091" ...
##  $ GEOID   : chr  "24510" "31169" "37077" "46091" ...
##  $ NAME    : chr  "Baltimore" "Thayer" "Granville" "Marshall" ...
##  $ LSAD    : chr  "25" "06" "06" "06" ...
##  $ ALAND   : num  2.10e+08 1.49e+09 1.38e+09 2.17e+09 1.09e+09 ...
##  $ AWATER  : num  2.88e+07 3.03e+06 1.45e+07 1.25e+08 3.70e+06 ...
##  $ geometry:sfc_MULTIPOLYGON of length 3108; first list element: List of 1
##   ..$ :List of 1
##   .. ..$ : num [1:44, 1:2] -76.7 -76.6 -76.6 -76.6 -76.5 ...
##   ..- attr(*, "class")= chr [1:3] "XY" "MULTIPOLYGON" "sfg"
##  - attr(*, "sf_column")= chr "geometry"
##  - attr(*, "agr")= Factor w/ 3 levels "constant","aggregate",..: NA NA NA NA NA NA NA NA NA
##   ..- attr(*, "names")= chr [1:9] "STATEFP" "COUNTYFP" "COUNTYNS" "AFFGEOID" ...
##  - attr(*, "tigris")= chr "county"
counties_WA = counties_us %>% dplyr::filter(STATEFP == '53')
str(counties_WA)
## Classes 'sf' and 'data.frame':   39 obs. of  10 variables:
##  $ STATEFP : chr  "53" "53" "53" "53" ...
##  $ COUNTYFP: chr  "013" "037" "033" "001" ...
##  $ COUNTYNS: chr  "01513273" "01531926" "01531933" "01531601" ...
##  $ AFFGEOID: chr  "0500000US53013" "0500000US53037" "0500000US53033" "0500000US53001" ...
##  $ GEOID   : chr  "53013" "53037" "53033" "53001" ...
##  $ NAME    : chr  "Columbia" "Kittitas" "King" "Adams" ...
##  $ LSAD    : chr  "06" "06" "06" "06" ...
##  $ ALAND   : num  2.25e+09 5.95e+09 5.48e+09 4.99e+09 6.81e+08 ...
##  $ AWATER  : num  1.26e+07 9.24e+07 4.98e+08 1.25e+07 6.16e+07 ...
##  $ geometry:sfc_MULTIPOLYGON of length 39; first list element: List of 1
##   ..$ :List of 1
##   .. ..$ : num [1:40, 1:2] -118 -118 -118 -118 -118 ...
##   ..- attr(*, "class")= chr [1:3] "XY" "MULTIPOLYGON" "sfg"
##  - attr(*, "sf_column")= chr "geometry"
##  - attr(*, "agr")= Factor w/ 3 levels "constant","aggregate",..: NA NA NA NA NA NA NA NA NA
##   ..- attr(*, "names")= chr [1:9] "STATEFP" "COUNTYFP" "COUNTYNS" "AFFGEOID" ...
##  - attr(*, "tigris")= chr "county"

Get Hospitals

hospitals = st_read("Hospitals.gdb")
## Reading layer `Hospitals' from data source 
##   `/Users/haroldnelson/Dropbox/WA Geodata/Hospitals.gdb' using driver `OpenFileGDB'
## Simple feature collection with 121 features and 17 fields
## Geometry type: POINT
## Dimension:     XY
## Bounding box:  xmin: 686589 ymin: 113179.4 xmax: 2509383 ymax: 1260766
## Projected CRS: NAD83(HARN) / Washington South (ftUS)
str(hospitals)
## Classes 'sf' and 'data.frame':   121 obs. of  18 variables:
##  $ NAME            : chr  "Eastern State Hospital" "Madigan Army Medical Center" "PeaceHealth United General Medical Center" "US Air Force Hospital" ...
##  $ LINK            : int  1 2 3 4 5 6 7 8 9 10 ...
##  $ ADDRESS         : chr  "Maple Street   P.O. Box A" "Ft. Lewis" "2000 Hospital Drive" "701 Hospital Loop" ...
##  $ CITY            : chr  "Medical Lake" "Tacoma" "Sedro-Woolley" "Fairchild Air Force" ...
##  $ ZIP             : chr  "99022" "98431" "98204" "98438" ...
##  $ ZIP4            : chr  "0045" "5000" " " "1130" ...
##  $ PHONE           : chr  "(509) 299-4351" "(253) 968-1215" "(360) 856-6021" "(509) 247-5216" ...
##  $ FAX             : chr  "" "(253) 968-0365" "(360)856-7204" "(509) 247-2170" ...
##  $ ACUTE           : chr  "No" "Yes" "Yes" "No" ...
##  $ ICU             : chr  "No" "Yes" "Yes" "No" ...
##  $ CAH             : chr  "No" "No" "Yes" "No" ...
##  $ Heli            : chr  "No" "Yes" "Yes" "Yes" ...
##  $ Weblink         : chr  "https://www.dshs.wa.gov/bhsia/division-state-hospitals/eastern-state-hospital-overview" "http://www.wsha.org/hospitalDetail.cfm?HID=147" "http://www.wsha.org/hospitalDetail.cfm?HID=4" "http://www.fairchild.af.mil/units/92ndmedicalgroup/index.asp" ...
##  $ Beds_Total      : int  317 222 6 48 23 366 27 17 28 31 ...
##  $ Beds_Total_ICU  : int  0 60 3 0 0 48 10 0 0 6 ...
##  $ Updated         : POSIXct, format: "2020-09-02 02:14:47" "2020-09-02 02:14:47" ...
##  $ Beds_Psychiatric: int  91 0 0 0 0 23 0 0 0 0 ...
##  $ Shape           :sfc_POINT of length 121; first list element:  'XY' num  2332977 829159
##  - attr(*, "sf_column")= chr "Shape"
##  - attr(*, "agr")= Factor w/ 3 levels "constant","aggregate",..: NA NA NA NA NA NA NA NA NA NA ...
##   ..- attr(*, "names")= chr [1:17] "NAME" "LINK" "ADDRESS" "CITY" ...
ggplot(hospitals) + geom_sf()

st_crs(hospitals)
## Coordinate Reference System:
##   User input: NAD83(HARN) / Washington South (ftUS) 
##   wkt:
## PROJCRS["NAD83(HARN) / Washington South (ftUS)",
##     BASEGEOGCRS["NAD83(HARN)",
##         DATUM["NAD83 (High Accuracy Reference Network)",
##             ELLIPSOID["GRS 1980",6378137,298.257222101,
##                 LENGTHUNIT["metre",1]]],
##         PRIMEM["Greenwich",0,
##             ANGLEUNIT["degree",0.0174532925199433]],
##         ID["EPSG",4152]],
##     CONVERSION["SPCS83 Washington South zone (US Survey feet)",
##         METHOD["Lambert Conic Conformal (2SP)",
##             ID["EPSG",9802]],
##         PARAMETER["Latitude of false origin",45.3333333333333,
##             ANGLEUNIT["degree",0.0174532925199433],
##             ID["EPSG",8821]],
##         PARAMETER["Longitude of false origin",-120.5,
##             ANGLEUNIT["degree",0.0174532925199433],
##             ID["EPSG",8822]],
##         PARAMETER["Latitude of 1st standard parallel",47.3333333333333,
##             ANGLEUNIT["degree",0.0174532925199433],
##             ID["EPSG",8823]],
##         PARAMETER["Latitude of 2nd standard parallel",45.8333333333333,
##             ANGLEUNIT["degree",0.0174532925199433],
##             ID["EPSG",8824]],
##         PARAMETER["Easting at false origin",1640416.667,
##             LENGTHUNIT["US survey foot",0.304800609601219],
##             ID["EPSG",8826]],
##         PARAMETER["Northing at false origin",0,
##             LENGTHUNIT["US survey foot",0.304800609601219],
##             ID["EPSG",8827]]],
##     CS[Cartesian,2],
##         AXIS["easting (X)",east,
##             ORDER[1],
##             LENGTHUNIT["US survey foot",0.304800609601219]],
##         AXIS["northing (Y)",north,
##             ORDER[2],
##             LENGTHUNIT["US survey foot",0.304800609601219]],
##     USAGE[
##         SCOPE["Engineering survey, topographic mapping."],
##         AREA["United States (USA) - Washington - counties of Adams; Asotin; Benton; Clark; Columbia; Cowlitz; Franklin; Garfield; Grant south of approximately 47°30'N; Grays Harbor; Kittitas; Klickitat; Lewis; Mason; Pacific; Pierce; Skamania; Thurston; Wahkiakum; Walla Walla; Whitman; Yakima."],
##         BBOX[45.54,-124.4,47.61,-116.91]],
##     ID["EPSG",2927]]

Hospital Map

tm_shape(hospitals) + tm_bubbles(size = "Beds_Total")

## Primmary Care Shortage Areas

short_areas = st_read("PRI_Shortage.gdb")
## Reading layer `PRI_Shortage' from data source 
##   `/Users/haroldnelson/Dropbox/WA Geodata/PRI_Shortage.gdb' using driver `OpenFileGDB'
## Simple feature collection with 4 features and 6 fields
## Geometry type: MULTIPOLYGON
## Dimension:     XY
## Bounding box:  xmin: 579553 ymin: 81836.92 xmax: 2551107 ymax: 1355592
## Projected CRS: NAD83(HARN) / Washington South (ftUS)
str(short_areas)
## Classes 'sf' and 'data.frame':   4 obs. of  7 variables:
##  $ HPSA_PRIMA      : chr  "0" "1" "2" "3"
##  $ Type            : chr  "No HPSA" "Geographic (Total Population)" "Low-Income Population" "Migrant Population"
##  $ Shape_STArea__  : num  1.84e+11 6.30e+11 7.78e+11 3.97e+11
##  $ Shape_STLength__: num  5523032 16145912 15096063 6491748
##  $ Shape_Length    : num  5523032 16145912 15096063 6491748
##  $ Shape_Area      : num  1.84e+11 6.30e+11 7.78e+11 3.97e+11
##  $ Shape           :sfc_MULTIPOLYGON of length 4; first list element: List of 3
##   ..$ :List of 2
##   .. ..$ : num [1:8658, 1:2] 1124266 1125953 1126349 1128035 1129216 ...
##   .. ..$ : num [1:117, 1:2] 1216227 1216322 1216471 1216640 1216870 ...
##   ..$ :List of 1
##   .. ..$ : num [1:1723, 1:2] 2486353 2486496 2486498 2486939 2486954 ...
##   ..$ :List of 1
##   .. ..$ : num [1:1398, 1:2] 1088930 1089012 1089098 1089280 1089367 ...
##   ..- attr(*, "class")= chr [1:3] "XY" "MULTIPOLYGON" "sfg"
##  - attr(*, "sf_column")= chr "Shape"
##  - attr(*, "agr")= Factor w/ 3 levels "constant","aggregate",..: NA NA NA NA NA NA
##   ..- attr(*, "names")= chr [1:6] "HPSA_PRIMA" "Type" "Shape_STArea__" "Shape_STLength__" ...

Map Shortage Areas

Include hospitals.

tm_shape(short_areas) + 
  tm_fill(col = "Type") +
tm_shape(hospitals) + 
  tm_bubbles(size = "Beds_Total")