plotC: Generate an Image of a Contact Matrix

Description Usage Arguments Examples

View source: R/plotC.R

Description

Generate an Image of a Contact Matrix

Usage

1
2
3
plotC(C, grouping = NULL, xlab = "age group of contact",
  ylab = "age group of participant", at = 15,
  col.regions = rev(heat.colors(length(at) - 1)), ..., contour = FALSE)

Arguments

C

a square numeric matrix.

grouping

numeric vector of sizes of aggregated groups, e.g., grouping = c(1,3), to draw separation lines after the first and the forth subgroup. This is ignored if contour = TRUE.

xlab, ylab

axis labels.

at

numeric vector of break points of the color levels, or a single integer specifying the number of cuts (which defaults to 15 as in levelplot).

col.regions

vector of color levels.

...

further arguments passed to levelplot or filled.contour (if contour = TRUE).

contour

logical indicating if a filled.contour should be drawn instead of a levelplot (the default).

Examples

1
2
3
4
5
6
7
8
9
## contour plot
plotC(contactmatrix_POLYMOD, contour = TRUE)

## level plots illustrating aggregation of age groups
if (require("gridExtra")) {
    grid.arrange(plotC(contactmatrix_POLYMOD, grouping = c(1,2,2,4,4,2)),
                 plotC(contactmatrix(grouping = c(1,2,2,4,4,2))),
                 nrow = 1)
}

hhh4contacts documentation built on July 4, 2017, 9:44 a.m.