tsm_ggbox: Boxplots for tsort.info data

Description Usage Arguments Value Examples

View source: R/tsort_ggplot.R

Description

Create boxplot including original data points.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
tsm_ggbox(
  data,
  xvar = artist,
  yvar = year,
  label = name,
  max_cats = 15,
  title = "Album release years",
  subtitle = "Boxplots and raw data points",
  farben = tmaptools::get_brewer_pal("Dark2", n = max_cats, plot = FALSE)
)

Arguments

data

data frame to use for plotting

xvar

categorical variable

yvar

continuous variable

label

a variable that can be used in plotly::ggploty() to label data points

max_cats

maximum number of categories to be displayed

title

plot title

subtitle

plot subtitle

farben

vector of colors. Defaults to palette "Dark2"

Value

ggplot object, so that it can be further manipulated (e. g. apply different theme, theme options)

Examples

1
2
3
4
5
6
7
library(dplyr)
tsm_ggbox(albums)
tsm_ggbox(albums, title = "Release years of albums by selected bands",
                  subtitle = "")
albums %>%
   filter(artist != "Original Soundtrack") %>%
   tsm_ggbox()

fjodor/tsortmusicr documentation built on May 16, 2020, 4:53 p.m.