tau_bar: Create a TauCharts bar chart (horizontal or vertical)

Description Usage Arguments References Examples

Description

Create a TauCharts bar chart (horizontal or vertical)

Usage

1
tau_bar(tau, x, y, color = NULL, size = NULL, horizontal = FALSE)

Arguments

tau

taucharts object

x

quoted name of data column to use for x-axis values

y

quoted name of data column to use for y-axis values

color

quoted name of data column to map color aesthetic to

size

quoted name of data column to make size aesthetic to

horizontal

should the bar chart be horizontal? (default: FALSE (no))

References

http://api.taucharts.com/basic/line.html

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
data(mpg, package="ggplot2")
tauchart(dplyr::count(mpg, class)) %>%
  tau_bar("class", "n")

# facets
tauchart(dplyr::count(mpg, manufacturer, class)) %>%
  tau_bar("class", c("manufacturer", "n"))
#facets
mfclass <- dplyr::count(mpg, manufacturer, model, class)
tauchart(mfclass) %>%
  tau_bar(c("manufacturer", "model"), "n")

# ordered factors on x-axis
mfclass$class <- factor(mfclass$class,
                        levels=c("2seater", "subcompact", "compact",
                                 "midsize", "minivan",  "suv", "pickup"),
                        ordered=TRUE)
tauchart(mfclass) %>%
  tau_bar(c("class", "manufacturer"), "n")

hrbrmstr/taucharts documentation built on May 17, 2019, 5:14 p.m.