Chart 1:Dentals in Philadelphia
library(leaflet)
library(foreign)
library(ggmap)
## Loading required package: ggplot2
## Google's Terms of Service: https://cloud.google.com/maps-platform/terms/.
## Please cite ggmap if you use it! See citation("ggmap") for details.
dat <- read.dbf("~/Downloads/pennsylv/pennsylv.dbf")
dental=subset(dat,dental=="Y")
dentalPA=subset(dental, city == "Philadelphia")
qmplot(x, y, data = dentalPA, color = "red", size = 1, darken = .1, extent = "panel", main = "Dentals in Philadelphia ", xlab = "Longitude", ylab = "Latitude")
## Using zoom = 14...
## Source : http://tile.stamen.com/terrain/14/4769/6200.png
## Source : http://tile.stamen.com/terrain/14/4770/6200.png
## Source : http://tile.stamen.com/terrain/14/4771/6200.png
## Source : http://tile.stamen.com/terrain/14/4772/6200.png
## Source : http://tile.stamen.com/terrain/14/4773/6200.png
## Source : http://tile.stamen.com/terrain/14/4769/6201.png
## Source : http://tile.stamen.com/terrain/14/4770/6201.png
## Source : http://tile.stamen.com/terrain/14/4771/6201.png
## Source : http://tile.stamen.com/terrain/14/4772/6201.png
## Source : http://tile.stamen.com/terrain/14/4773/6201.png
## Source : http://tile.stamen.com/terrain/14/4769/6202.png
## Source : http://tile.stamen.com/terrain/14/4770/6202.png
## Source : http://tile.stamen.com/terrain/14/4771/6202.png
## Source : http://tile.stamen.com/terrain/14/4772/6202.png
## Source : http://tile.stamen.com/terrain/14/4773/6202.png
## Source : http://tile.stamen.com/terrain/14/4769/6203.png
## Source : http://tile.stamen.com/terrain/14/4770/6203.png
## Source : http://tile.stamen.com/terrain/14/4771/6203.png
## Source : http://tile.stamen.com/terrain/14/4772/6203.png
## Source : http://tile.stamen.com/terrain/14/4773/6203.png
## Source : http://tile.stamen.com/terrain/14/4769/6204.png
## Source : http://tile.stamen.com/terrain/14/4770/6204.png
## Source : http://tile.stamen.com/terrain/14/4771/6204.png
## Source : http://tile.stamen.com/terrain/14/4772/6204.png
## Source : http://tile.stamen.com/terrain/14/4773/6204.png
## Source : http://tile.stamen.com/terrain/14/4769/6205.png
## Source : http://tile.stamen.com/terrain/14/4770/6205.png
## Source : http://tile.stamen.com/terrain/14/4771/6205.png
## Source : http://tile.stamen.com/terrain/14/4772/6205.png
## Source : http://tile.stamen.com/terrain/14/4773/6205.png

Chart 2: Hospital having CT Scan in Philadelphia County
library(leaflet)
library(foreign)
library(ggmap)
dat <- read.dbf("~/Downloads/pennsylv/pennsylv.dbf")
ctscan=subset(dat,ct_scan=="Y")
ctscanPA=subset(ctscan, county == "Philadelphia")
qmplot(x, y, data = ctscanPA, color = "red", size = 1, darken = .1, extent = "panel", main = "Hospital having CT Scan in Philadelphia County ", xlab = "Longitude", ylab = "Latitude")
## Using zoom = 12...
## Source : http://tile.stamen.com/terrain/12/1191/1549.png
## Source : http://tile.stamen.com/terrain/12/1192/1549.png
## Source : http://tile.stamen.com/terrain/12/1193/1549.png
## Source : http://tile.stamen.com/terrain/12/1194/1549.png
## Source : http://tile.stamen.com/terrain/12/1191/1550.png
## Source : http://tile.stamen.com/terrain/12/1192/1550.png
## Source : http://tile.stamen.com/terrain/12/1193/1550.png
## Source : http://tile.stamen.com/terrain/12/1194/1550.png
## Source : http://tile.stamen.com/terrain/12/1191/1551.png
## Source : http://tile.stamen.com/terrain/12/1192/1551.png
## Source : http://tile.stamen.com/terrain/12/1193/1551.png
## Source : http://tile.stamen.com/terrain/12/1194/1551.png

Chart 3: Number of ICU beds in Philadelphia
library(leaflet)
library(foreign)
library(ggmap)
dat <- read.dbf("~/Downloads/pennsylv/pennsylv.dbf")
icu1=subset(dat,icu=="Y")
icubedsPA=subset(icu1, county == "Philadelphia")
qmplot(x, y, data = icubedsPA, color = I("blue"), size = icu_beds,main = "Number of ICU beds in Philadelphia",xlab = "Longitude", ylab = "Latitude"
)
## Using zoom = 12...

Chart 4: PA Hospital having Organ Bank
library(leaflet)
library(foreign)
library(ggmap)
dat <- read.dbf("~/Downloads/pennsylv/pennsylv.dbf")
HospitalPA=subset(dat, city == "Philadelphia")
qmplot(x, y, data = HospitalPA, color = "green", size = 1, darken = .1, extent = "device", main = "PA Hospital having Organ Bank", xlab = "Longitude", ylab = "Latitude")+geom_point(aes(x, y, colour = organ_bank), data = dat)
## Using zoom = 12...
## Source : http://tile.stamen.com/terrain/12/1195/1549.png
## Source : http://tile.stamen.com/terrain/12/1195/1550.png
## Source : http://tile.stamen.com/terrain/12/1195/1551.png
## Warning: Removed 235 rows containing missing values (geom_point).

Chart 5: All Hospital in Philadelphia
library(leaflet)
library(foreign)
library(ggmap)
dat <- read.dbf("~/Downloads/pennsylv/pennsylv.dbf")
HospitalPA=subset(dat, city == "Philadelphia")
qmplot(x, y, data = HospitalPA, color = "green", size = 1, darken = .1, extent = "device", main = "All Hospital in Philadelphia", xlab = "Longitude", ylab = "Latitude")
## Using zoom = 12...
