tsm_ggbox: Boxplots for tsort.info data

View source: R/tsort_ggplot.R

tsm_ggboxR Documentation

Boxplots for tsort.info data

Description

Create boxplot including original data points.

Usage

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


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 Jan. 26, 2025, 9:58 p.m.