Objectives

Using the spatial visualization techniques, exploring the data set on Pennsylvania hospitals (http://www.arcgis.com/home/item.html?id=eccee5dfe01e4c4283c9be0cfc596882) to create a series of 5 maps that highlight spatial differences in hospital service coverage for the state of PA.

The dataset contains a number of variables about each hospital, many of them are clear and straight forward.

Here, we are creating spatial mappings with ggmap library for viz of the PA hospitals providing different services.

Map 1

dat_icu<- subset(dat, dat$icu== "Y")
qmplot(x, y, data = dat_icu, legend = "none", color= I('red'), mapcolor = "color",darken = 0.1, main = "PA Hospitals with ICU's", xlab = "Longitude", ylab = "Latitude", source = 'google', maptype = 'terrain', size = I(3),zoom = 7, extent = "panel")

Map 2

dat_xray<- subset(dat, dat$diag_xray== "Y")
qmplot(x, y, data = dat_xray, legend = "none", color= I('black'), mapcolor = "color",darken = 0.1, main = "PA Hospitals with X-Ray diagnosis", xlab = "Longitude", ylab = "Latitude", source = 'google', maptype = 'terrain', size = I(3),zoom = 7, extent = "panel")

Map 3

dat_flu<- subset(dat,dat$pharmacy=="Y")
qmplot(x, y, data = dat_flu, legend = "none", color= I('blue'), mapcolor = "color",darken = 0.1, main = "PA Hospitals with pharmacy", xlab = "Longitude", ylab = "Latitude", source = 'google', maptype = 'hybrid', size = I(3),zoom = 7, extent = "panel")

Map 4

dat_pittsicu<- subset(dat_icu,dat$city=="Pittsburgh")
qmplot(x, y, data = dat_pittsicu, legend = "none", color= I('red'), mapcolor = "color",darken = 0.1, main = "Hospitals with ICU facility at pittsburg", xlab = "Longitude", ylab = "Latitude", source = 'google', maptype = 'roadmap', size = I(3),zoom = 7, extent = "panel")

Map 5

dat_xray<- subset(dat_xray, dat$so_flu_65u=="Y")
qmplot(x, y, data = dat_xray, legend = "none", color= I('tomato'), mapcolor = "color",darken = 0.1, main = "PA Hospitals with X-Ray diagnosis and Vaccination", xlab = "Longitude", ylab = "Latitude", source = 'google', maptype = 'terrain', size = I(3),zoom = 7, extent = "panel")