Learn R Programming

violinmplot (version 0.2.1)

violinmplot: Combined violin plot with arithmetic mean and standard deviation.

Description

This function combines a violin plot from the package lattice with values for the arithmetic mean and standard deviation.

Usage

violinmplot(x, data, ...)

Arguments

x
a formula describing the plot, typically of the form y ~ x.
data
the data frame containing values for any variables in the formula provided as argument x.
...
further arguments which are passed on to other functions used by this package. Possible arguments are as follows:
horizontal
Whether to display the plots horizontally. Defaults to TRUE.

grid
Whether to display grid lines. Defaults to TRUE
.
col.mean
color for the arithmetic mean. Defaults to "blue"

col.violin
fill color for the violin plot. Defaults to "transparent"
.

Value

An object of calss "trellis". The update.trellis method can be used too update components of the object and the print.trellis method (usually called by default) will plot it on an appropriate plotting device.

Details

References

The package was developed for a 2009 German national survey of usability in healthcare IT. http://www.usabil-it.de/2009/ (in German)

See Also

Lattice

Examples

Run this code
library(violinmplot)

## Sample data frame
x <- c(1,1,1,2,2,3, 1,2,2,3,3,3)
g <- c(1,1,1,1,1,1, 2,2,2,2,2,2)
f <- data.frame("Daten"=x,"Gruppe"=g)

## Display a horizontal violinmplot 
violinmplot( Gruppe ~ Daten, data=f )

## Same plot displayed vertically
violinmplot( Daten ~ Gruppe, data=f, horizontal=FALSE)

Run the code above in your browser using DataLab