data("measlesWeserEms")
# default plot: total region-specific counts over all weeks
plot(measlesWeserEms, type = observed ~ unit)
stsplot_space(measlesWeserEms) # the same
# cumulative incidence (per 100'000 inhabitants),
# with region labels and white borders
plot(measlesWeserEms, observed ~ unit,
population = measlesWeserEms@map$POPULATION / 100000,
labels = list(labels = "GEN", cex = 0.7, font = 3),
col = "white", lwd = 2,
sub = "cumulative incidence (per 100'000 inhabitants)")
# incidence in a particular week, manual color breaks, display total
plot(measlesWeserEms, observed ~ unit, tps = 62,
population = measlesWeserEms@map$POPULATION / 100000,
at = c(0, 1, 5),
total.args = list(x = 0, label = "Overall incidence: "))
# if we had only observed a subset of the regions
plot(measlesWeserEms[,5:11], observed ~ unit,
gpar.missing = list(col = "gray", lty = 4))
Run the code above in your browser using DataLab