geom_flat_violin: geom_flat_violin

Description Usage Arguments Value

View source: R/geom_flat_violin.R

Description

The source code from the solution to:

https://twitter.com/EamonCaddigan/status/646759751242620928

The url of the source code is:

https://gist.githubusercontent.com/benmarwick/2a1bb0133ff568cbe28d/raw/fb53bd97121f7f9ce947837ef1a4c65a73bffb3f/geom_flat_violin.R

This function based mostly on copy/pasting from ggplot2 geom_violin source:

https://github.com/hadley/ggplot2/blob/master/R/geom-violin.r

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
geom_flat_violin(
  mapping = NULL,
  data = NULL,
  stat = "ydensity",
  position = "dodge",
  trim = TRUE,
  scale = "area",
  show.legend = NA,
  inherit.aes = TRUE,
  ...
)

Arguments

mapping

Set of aesthetic mappings.

data

The data to be displayed in this layer.

stat

The statistical transformation to use on the data for this layer.

position

Position adjustment, either as a string, or the result of a call to a position adjustment function.

trim

whether trim the tails of the violins to the range of the data.

scale

if "area" (default), all violins have the same area (before trimming the tails). If "count", areas are scaled proportionally to the number of observations. If "width", all violins have the same maximum width.

show.legend

logical. Should this layer be included in the legends?

inherit.aes

whether inherit aesthetic mapping from 'ggplot'

...

additional parameters

Value

One side flat of geom_violin in ggplot2


Zachary-Wu/learn documentation built on Aug. 14, 2020, 12:39 a.m.