## compare traditional plot() with ggplot2-based autoplot.sts()
if (requireNamespace("ggplot2")) {
data("measlesDE")
plot(measlesDE, units = 1:2)
autoplot.sts(measlesDE, units = 1:2)
}
## weekly incidence: population(measlesDE) gives population fractions,
## which we need to multiply by the total population
if (require("ggplot2", quietly = TRUE)) {
autoplot.sts(measlesDE, population = 1000000/82314906) +
ylab("Weekly incidence [per 1'000'000 inhabitants]")
}
Run the code above in your browser using DataLab