Description Usage Arguments Details Value Examples
Group variable on the horizontal axis into equal-sized bins and calculate group means for each bin.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
data |
A dataset |
x |
horizontal axis variable |
y |
vertical axis variable |
color |
Character. Variables to group on. With changing color |
type |
Type of geom to plot ("point" (default), "pointrange", "line") |
bins |
Numeric. Number of bins (default: 20) |
xlims, ylims |
Numeric vectors of 2 elements. Axis limits |
title |
Plot title |
xlab, ylab |
Axis labels |
colorname |
Optional variable names for groups to be displayed on legend |
colorlabels |
Optional labels for grouos to be displayed on legend |
legendpos |
Legend position. Options: “left”,“top”, “right” (default), “bottom” |
Backend code source: https://github.com/maximilianeber/binscatter (Maximilian Eber)
A ggplot2-plot
1 | niceBinscatter(ggplot2::mpg, "displ", "hwy", color = "class", type = "pointrange")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.