Visualisation of a two-dimensional binning based on equidistant or quantile based binning.
binningplot(x, y, b = 10, bin = "equi", anchor = "min")
A numeric vector.
A numeric vector.
A positive integer. Number of bins in each variable.
A chraracter string. Binning method "equi" (default) for equidistant binning or "quant" for quantile binning.
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.
A ggplot object.
H. Wickham (2009) ggplot2: Elegant Graphics for Data Analysis New York: Springer
# 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