Learn R Programming

mbgraphic (version 1.0.1)

binningplot: Two-dimensional binningplot

Description

Visualisation of a two-dimensional binning based on equidistant or quantile based binning.

Usage

binningplot(x, y, b = 10, bin = "equi", anchor = "min")

Arguments

x

A numeric vector.

y

A numeric vector.

b

A positive integer. Number of bins in each variable.

bin

A chraracter string. Binning method "equi" (default) for equidistant binning or "quant" for quantile binning.

anchor

A chraracter string or a numeric. How should the anchorpoint be chosen? "min" (default) for the minimum of each variable, "ggplot" for the method used in ggplot graphics, "nice" for a "pretty"" anchor point, or a user specified value.

Value

A ggplot object.

References

H. Wickham (2009) ggplot2: Elegant Graphics for Data Analysis New York: Springer

See Also

binning

Examples

Run this code
# NOT RUN {
x <- rnorm(10000)
y <- rnorm(10000)

# equidistant binning with 20 bins in each variable
binningplot(x,y,b=20)

# quantile based binning with 20 bins in each variable
binningplot(x,y,b=20,bin="quant")
# }

Run the code above in your browser using DataLab