tile_plot: Tile plot

Description Usage Arguments Value Author(s) Examples

View source: R/tile_plot.R

Description

Tile plot

Usage

1
2
3
tile_plot(data, x.col, y.col, x.lab = "", y.lab = "", text = FALSE,
  colour = "red", angle = 0, label.breaks = 0,
  rescale.by.row = FALSE, keep.row.order = FALSE)

Arguments

data

a data frame

x.col

a character containing the column to be used along the x-axis of the tile plot

y.col

a character containing the column to be used along the y-axis of the tile plot

x.lab

a character containing the label for the x-axis

y.lab

a character containing the label for the y-axis

text

a logical specifying if numeric values should be overlayed as text

colour

a character containing the colour for the tile plot

angle

a numeric to specify the x-axis label angel for the epicurve

label.breaks

a numeric specifying x-axis label breaks

rescale.by.row

a logical specifying if the colours on the tile plot should be relative to all tiles or relative to other tiles within a single row

keep.row.order

a logical specifying if the order of the rows should be kept as is or changed to most common

Value

a tile plot

Author(s)

Daniel Gardiner (daniel.gardiner@phe.gov.uk)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# create dummy data

set.seed(3)

data = data.frame(geog = sample(c("Vienna", "Vienna", "Vienna", "Vienna",
                                  "Salzburg", "Innsbruck", "Graz", "Graz",
                                  "Linz", "Klagenfurt", "Villach"), 5000, replace = TRUE),
                  age.group = sample(c("0-19", "20-39", "40-59", "60+", "60+"), 5000, replace = TRUE),
                  week = factor(sample(paste0("week.", 1:30), 5000, replace = TRUE),
                                levels = paste0("week.", 1:30)))

# example plot 1

tile_plot(data, x.col = "week", y.col = "geog", keep.row.order = TRUE)

# example plot 2

tile_plot(data, x.col = "week", y.col = "geog", keep.row.order = FALSE)

# example plot 3

tile_plot(data, x.col = "week", y.col = "geog", text = TRUE)

# example plot 4

tile_plot(data, x.col = "week", y.col = "geog", text = TRUE, label.breaks = 2)

# example plot 5

tile_plot(data, x.col = "week", y.col = "geog", text = TRUE, label.breaks = 2,
          rescale.by.row = TRUE)

DanielGardiner/EpiFunc documentation built on July 25, 2019, 10:53 p.m.