qbin_barplot() shows the median or mean for each quantile bin, thereby focusing on
the expected value per qbin().
For a conditional plot, see cond_barplot().
a data.frame to be binned
character variable name used for the quantile binning
integer number of quantile bins.
integer minimum number of rows/data points that should be
in a quantile bin. If NULL it is initially sqrt(nrow(data))
logical if TRUE the quantile bins will overlap. Default value will be
FALSE.
The number of column to be used in the layout.
The color to use for the bars.
The type of statistic to use for the bars.
Additional arguments to pass to the plot functions
A list of ggplot objects.
The table_plot is a specific form of qbin_barplot
with ncols set to ncol(data).
Other qbin plotting functions:
qbin_boxplot(),
qbin_heatmap(),
qbin_lineplot()
# \donttest{
data("diamonds", package="ggplot2")
table_plot(diamonds[c(1:4, 7)], "carat")
qbin_barplot(iris, "Sepal.Length", n = 12)
table_plot(iris, "Sepal.Length", n=12)
table_plot(
iris,
x = "Sepal.Length",
min_bin_size=20,
overlap=TRUE
)
if (require(palmerpenguins)) {
table_plot(penguins[1:7], "body_mass_g", 19)
}
# }