Learn R Programming

fingertipscharts (version 0.0.11)

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

Description

Plot an overview (tartan rug) of multiple indicators

Usage

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

Run this code
# NOT RUN {
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
# }

Run the code above in your browser using DataLab