Plot a table on the current graphic device. Useful for risk tables.

plot_table(
  x,
  main = character(),
  xlab = character(),
  ylab = character(),
  at = seq_len(nrow(x)) - 1L,
  xlim = range(at),
  ylim = c(0L, ncol(x)),
  ylabels = TRUE,
  col = rep_len(1L, ncol(x)),
  xaxis = TRUE,
  cex.xaxis = 3/4,
  cex.yaxis = 1.25,
  cex.text = 1.5,
  ...
)

Arguments

x

matrix, it is transposed on the graphic device. The column names correspond to the y labels and the row names to the x labels.

main

character(1), plot title.

xlab

character(1), x-axis label.

ylab

character(1), y-axis label.

at

numeric, where to plot the rows of x`.

xlim

numeric(2), limits of the x-axis.

ylim

numeric(2), limits of the y-axis.

ylabels

logical(1), should the column names used to labels the y-axis (default: TRUE)?

col

integer/character, specifying the color for each y/column label.

xaxis

logical(1), should the x-axis be plotted (default: TRUE)?

cex.xaxis

numeric(1), character expansion factor for the x-axis labels, see par() for details.

cex.yaxis

numeric(1), character expansion factor for the y-axis labels, see par() for details.

cex.text

numeric(1), character expansion factor for the cell content labels, see par() for details.

...

further arguments passed to plot.default().

Value

nothing, used for its side-effects (plotting).

Examples

m <- matrix(
    1:8, nrow = 4,
    dimnames = list(c(0, 30, 90, 365), LETTERS[1:2])
)
plot_table(m, main = "Cumulative number of events")