ggViolin.plot: Violin plots of Continuous Variable with ggplot2

Description Usage Arguments Author(s) See Also Examples

View source: R/ggViolin.plot.R

Description

Create violin plot of data with interior bars representing median and 50

Usage

1
2
ggViolin.plot(data, x, y, facet = NULL, fill.col = NULL,
	facet.cols = NULL, scales = "fixed", CI = .5)

Arguments

data

a dataframe

x

a character vector containing the name of the column in data containing factor whose levels will be plotted on the x-axis.

y

a character vector containing the name of the column in data containing numeric vector whose values will be represented by the boxes.

facet

character vector containing name(s) of one or two additional factors in data by which the plot will be faceted.

fill.col

a character vector specifying the color of the boxes. Default is gray.

facet.cols

numeric. Number of columns in display of faceted plots.

scales

character vector specifying whether scales should be fixed across facets. Values are "fixed", or "free".

CI

numeric. Confidence interval to be plotted as bars inside violin plots. Must be value between 0 and 1.

...

additional options.

Author(s)

Jason Grafmiller

See Also

ggplot2, geom_violin, stat_summary.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
data(brown_genitives)

## plot the distribution of type-token ratios by genre
ggViolin.plot(brown_genitives, "Genre", "TypeTokenRatio")

## plot the distribution of type-token ratios by
## genre and construction type
ggViolin.plot(brown_genitives, "Genre", "TypeTokenRatio",
	facet = "Type")

## plot the distribution of type-token ratios by
## genre, possessor animacy and construction type
ggViolin.plot(brown_genitives, "Genre", "TypeTokenRatio",
	facet = c("PossrAnimacyBin", "Type")

jasongraf1/JGggplot documentation built on May 29, 2019, 11:43 a.m.