quik_bullets: Plot a quik bullet plot

Description Usage Arguments Examples

View source: R/plots.R

Description

ggquik has specific standards for plots, and quik_bullets helps your plot follow these. A bullet plot http://en.wikipedia.org/wiki/Bullet_graph is a bar plot with additional progress indicators. None are required, but the options are a partial fill, a dotted line, and a solid line.

Usage

1
2
3
4
5
quik_bullets(df, group_col, range_low, range_high, bar_fill = NULL,
                     dotted_line = NULL, solid_line = NULL, text_size = 3,
                     palette_type = 'qualitative', line_colors = "Purple", 
                     fill_color = NULL, currency = NULL, 
                     measure_unit = NULL, measure_decimal = 0, ...)

Arguments

df

The data frame containing plot data

group_col

The column containing the different groups to be faceted

range_low

The column with the low end of the bar

range_high

The column with the high end of the bar

bar_fill

The column with the distance to fill the bar (if needed)

dotted_line

The column with the dotted line distance (if needed)

solid_line

The column with the solid line distance (if needed)

text_size

The size of the label text size. Default is 3

palette_type

A string. Allowed values are "diverging", "sequential", and "qualitative". Default is "qualitative".

line_colors

A string. What color should be used for the lines (e.g. "gray", "red", "dark red", "blue", "dark blue", "light blue", gold", "green", "purple", "teal")

fill_color

A string. What color should be used for the bar (e.g. "gray", "red", "dark red", "blue", "dark blue", "light blue", gold", "green", "purple", "teal")

currency

A string, usually $

measure_unit

A string. Can be %, K, or M

measure_decimal

An integer. The number of decimal places to show.

...

Parameters to pass on to facet_wrap, such as nrow or ncol

Examples

1
2
3
4
5
6
7
8
# load a sample data frame
df <- data.frame(group = factor(c('Reliability', 'Accuracy', 'Uptime', 'Efficiency')),
                  dotted = sample(90:100, 4), solid = sample(80:100, 4),
                  fill = sample(80:100, 4), low = c(50, 75, 80, 80), high = rep(100, 4))
# create a plot
ggq <- quik_bullets(df, group_col = 'group', range_low = 'low', range_high = 'high',
                    bar_fill = 'fill', solid_line = 'solid', dotted_line = 'dotted')
quik_theme(ggq, axis.text = 'x')

brascoball/ggquik documentation built on Feb. 14, 2021, 5:17 p.m.