| plot,mdt,missing-method | R Documentation |
S4 method for the plot generic: visualises the
decrement structure of an mdt object. Three views are available:
a stacked-area chart of death counts d^{(j)}_x (default), a stacked
bar chart, or a line chart of decrement probabilities
q^{(j)}_x = d^{(j)}_x / l^{(\tau)}_x.
## S4 method for signature 'mdt,missing'
plot(x, y, type = c("area", "bar", "probability"), ...)
x |
An |
y |
Not used (kept for S4 generic compatibility). |
type |
Character: one of |
... |
Further arguments (currently unused). |
A ggplot2 object (returned invisibly).
valdezDf <- data.frame(
x = 50:54,
lx = c(4832555, 4821937, 4810206, 4797185, 4782737),
heart = c(5168, 5363, 5618, 5929, 6277),
accidents = c(1157, 1206, 1443, 1679, 2152),
other = c(4293, 5162, 5960, 6840, 7631))
valdezMdt <- new("mdt", name = "ValdezExample", table = valdezDf)
plot(valdezMdt)
plot(valdezMdt, type = "bar")
plot(valdezMdt, type = "probability")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.