sg_fill_tableau: Use Tableau discrete palettes for streamgraph fill colors

Description Usage Arguments Value Examples

View source: R/color.r

Description

Tableau discrete palettes provide colour schemes which are particularly suited and tested to display categorical values.

Usage

1
sg_fill_tableau(sg, palette = "tableau20")

Arguments

sg

streamgraph object

palette

Tableau discrete pallete atomic character value (defaults to tableau20). Must be one of c("tableau20", "tableau10medium", "gray5", "colorblind10", "trafficlight", "purplegray12", "bluered12", "greenorange12", "cyclic")

Value

streamgraph object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
library(dplyr)
library(streamgraph)
ggplot2movies::movies %>%
select(year, Action, Animation, Comedy, Drama, Documentary, Romance, Short) %>%
  tidyr::gather(genre, value, -year) %>%
  group_by(year, genre) %>%
  tally(wt=value) %>%
  ungroup %>%
  mutate(year=as.Date(sprintf("%d-01-01", year))) -> dat

streamgraph(dat, "genre", "n", "year") %>%
  sg_fill_tableau("purplegray12")

## End(Not run)

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