overview: Plot an overview (tartan rug) of multiple indicators

Description Usage Arguments Value See Also Examples

View source: R/quick_charts.R

Description

Plot an overview (tartan rug) of multiple indicators

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
overview(
  data,
  area,
  indicator,
  value,
  fill,
  timeperiod,
  top_areas,
  wrap_length = 50,
  value_label_size = 1,
  legend_position = "none"
)

Arguments

data

data.frame object to plot using ggplot2 functions

area

field containing area names (unquoted)

indicator

field containing indicator names (unquoted)

value

field containing variable to be plotted (unquoted)

fill

field to be used to determine the colouring of the bars (unquoted)

timeperiod

field containing the time period (unquoted)

top_areas

character vector; the areas to fix at the left

wrap_length

number; maximum number of characters in indicator before wrapping it

value_label_size

number; amount to scale the size of the value label

legend_position

the position of legends ("none", "left", "right", "bottom", "top", or two-element numeric vector)

Value

a ggplot of the overview/tartan rug plot

See Also

Other quick charts: box_plots(), compare_areas(), compare_indicators(), map(), population(), trends()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
library(dplyr)
df <- create_test_data()

parent <- "PAC14"
top_names <- c("C001", parent)
df_over <- df %>%
        filter((AreaCode %in% top_names |
                        ParentAreaCode == parent)) %>%
        mutate(Value = round(Value, 1))
p <- overview(df_over,
              area = AreaCode,
              indicator = IndicatorName,
              value = Value,
              timeperiod = Timeperiod,
              fill = Significance,
              top_areas = top_names,
              wrap_length = 40,
              value_label_size = 0.8)
p

fingertipscharts documentation built on July 2, 2020, 2:59 a.m.