This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.
When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
library(HistData)
## Warning: package 'HistData' was built under R version 3.2.5
library(ggmap)
## Warning: package 'ggmap' was built under R version 3.2.5
## Loading required package: ggplot2
## Warning: package 'ggplot2' was built under R version 3.2.5
library(ggplot2)
get_london <-get_map(c(-.137,51.513), zoom=18)
## Map from URL : http://maps.googleapis.com/maps/api/staticmap?center=51.513,-0.137&zoom=18&size=640x640&scale=2&maptype=terrain&language=en-EN&sensor=false
london <-ggmap(get_london)
require(lubridate)
## Loading required package: lubridate
## Warning: package 'lubridate' was built under R version 3.2.5
##
## Attaching package: 'lubridate'
## The following object is masked from 'package:base':
##
## date
clr<-ifelse(Snow.dates$date<mdy("09/08/1854"),"pink","cyan")
plot(deaths~date, data=Snow.dates, type="h", lwd=2,col=clr)
points(deaths~date, data=Snow.dates, cex=0.5,pch=16,col=clr)
text(mdy("09/08/1854"),40,"Pump handle/nremoved Sept. 8",pos=4)
SnowMap()
SnowMap(polygons=TRUE, main="Snow's Cholera map with Pump Polygons")
SnowMap(xlim=c(7.5,16.5), ylim=c(7,16), polygons=TRUE, density=TRUE,main="Snow's Cholera Map Annotated")