Learn R Programming

daltoolbox (version 1.2.747)

plot_boxplot: Plot boxplot

Description

Boxplots for each numeric column of a data.frame.

Usage

plot_boxplot(data, label_x = "", label_y = "", colors = NULL, barwidth = 0.25)

Value

returns a ggplot2::ggplot graphic

Arguments

data

data.frame with one or more numeric columns

label_x

x‑axis label

label_y

y‑axis label

colors

optional fill color for boxes

barwidth

width of the box (numeric)

Details

The data is melted to long format and a box is drawn per original column. If colors is provided, a constant fill is applied to all boxes. Use barwidth to control box width.

Examples

Run this code
grf <- plot_boxplot(iris, colors="white")
plot(grf)

Run the code above in your browser using DataLab