ggDot: Draw a Wilkinson dot plot

Description Usage Arguments Examples

Description

Draw a Wilkinson dot plot

Usage

1
2
3
ggDot(data, xvar, yvar = NULL, fillvar = NULL, stackdir = "center",
  binaxis = "y", binwidth = 0.5, method = "dotdensity", position = 0.2,
  boxwidth = 0.25, boxfill = NULL, ...)

Arguments

data

a data.frame

xvar

A character string of column name be used as a x-axis variable

yvar

A character string of column name be used as a y-axis variable.

fillvar

A character string of column name be used as a fill variable. Default value is NULL

stackdir

which direction to stack the dots. "up" (default), "down", "center", "centerwhole" (centered, but with dots aligned)

binaxis

The axis to bin along, "x" (default) or "y"

binwidth

When method is "dotdensity", this specifies maximum bin width. When method is "histodot", this specifies bin width. Defaults to 1/30 of the range of the data

method

"dotdensity" (default) for dot-density binning, or "histodot" for fixed bin widths (like stat_bin)

position

Position adjustment. If 0, no adjustment.

boxwidth

The width of boxplot

boxfill

Fill color of boxplot

...

other arguments passed on to geom_dotplot

Examples

1
2
3
4
5
6
7
8
require(ggplot2)
require(gcookbook) # for data heightweight
require(moonBook) #for use data radial
ggDot(radial,yvar="height",xvar="sex",fillvar="sex",boxfill="white",position=0,binwidth=1,boxwidth=1)
ggDot(heightweight,yvar="heightIn",xvar="sex",binwidth=0.4)
ggDot(radial,xvar="height",fillvar="sex",binwidth=1)
ggDot(heightweight,xvar="heightIn")
ggDot(heightweight,xvar="heightIn",fillvar="sex")

cardiomoon/moonBook2 documentation built on May 13, 2019, 12:40 p.m.