SnowMap | R Documentation |
The main function SnowMap
draws versions of John Snow's map of cholera deaths in
the South London area surrounding the Borad Street pump.
during the 1854 outbreak.
It is a wrapper for the various subfunctions also listed here:
Splot
sets up the basic plot
Sstreets
draws the streets
Sdeaths
plots the deaths
Sdeaths
plots the pump locations
Sscale
draws the scale
Spolygons
draws the boundaries of the Voronoi polygons separating the pumps
Sdensity
draws and fills contours of the 2D density of deaths
SnowMap(xlim = c(3, 20), ylim = c(3, 20),
axis.labels = FALSE, main = "Snow's Cholera Map of London",
scale = TRUE, polygons = FALSE, density=FALSE,
streets.args = list(col = "grey", lwd = 1),
deaths.args = list(col = "red", pch = 15, cex = 0.6),
pumps.args = list(col = "blue", pch = 17, cex = 1.5, cex.lab = 0.9),
scale.args = list(xs = 3.5, ys = 19.7),
polygons.args = list(col=NA, border="brown", lwd=2, lty=1),
density.args=list(bandwidth=c(0.5,0.5),
col1=rgb(0,1,0,0),
col2=rgb(1,0,0,.8))
)
Splot(xlim = c(3, 20), ylim = c(3, 20),
xlab = "", ylab = "",
axis.labels = FALSE,
main = "Snow's Cholera Map of London")
Sdeaths(col = "red", pch = 15, cex = 0.6)
Spumps(col = "blue", pch = 17, cex = 1.5, cex.lab = 0.9)
Sstreets(col = "gray", lwd = 1)
Sscale(xs = 3.5, ys = 19.7)
Spolygons(col=NA, border="brown", lwd=2, lty=1)
Sdensity(bandwidth = c(0.5, 0.5), col1 = rgb(0, 1, 0, 0), col2 = rgb(1, 0, 0, 0.8))
xlim |
Limit for the horizontal axis. Specify ranges smaller than the defaults to zoom the plot. |
ylim |
Limit for the vertical axis. |
axis.labels |
Logical. Show axis tick mark labels? |
main |
Plot title |
scale |
Logical; draw a scale (in meters) on the plot |
polygons |
Logical; Use |
density |
Logical; Use |
streets.args |
List of arguments passed to |
deaths.args |
List of arguments passed to |
pumps.args |
List of arguments passed to |
scale.args |
List of arguments passed to |
polygons.args |
List of arguments passed to |
density.args |
List of arguments passed to |
xlab |
Label for horizontal axis |
ylab |
Label for vertical axis |
col |
Color of points and lines used by various functions |
pch |
Point character used by by various functions |
cex |
Character size used by by various functions |
cex.lab |
Character size for labels used by |
lwd |
Line width used by by various functions |
border |
Color of border lines used by |
xs |
x location of the scale used by |
ys |
y location of the scale used by |
lty |
Line type used by by various functions |
bandwidth |
Bandwidth used by |
col1 |
Lower level of color range used by |
col2 |
Upper level of color range used by |
None
Michael Friendly
Snow, J. (1885). On the Mode of Communication of Cholera. London: John Churchill
Thomas Coleman, "John Snow Research project",
https://www.hilerun.org/econ/papers/snow/index.html
gives extensive analyses of Snow's data with R notebooks on Github.
Snow
for description of the data sets
bkde2D
,
colorRampPalette
SnowMap()
SnowMap(axis.labels=TRUE)
SnowMap(deaths.args=list(col="darkgreen"))
SnowMap(polygons=TRUE, main="Snow's Cholera Map with Pump Polygons")
SnowMap(density=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.