Learn R Programming

daltoolbox (version 1.1.727)

plot_boxplot_class: Boxplot per class

Description

This function generates boxplots grouped by a specified class label from a data frame containing numeric values using ggplot2.

Usage

plot_boxplot_class(
  data,
  class_label,
  label_x = "",
  label_y = "",
  colors = NULL
)

Value

returns a ggplot graphic

Arguments

data

data.frame contain x, value, and variable

class_label

name of attribute for class label

label_x

x-axis label

label_y

y-axis label

colors

color vector

Examples

Run this code
grf <- plot_boxplot_class(iris |> dplyr::select(Sepal.Width, Species),
 class = "Species", colors=c("red", "green", "blue"))
plot(grf)

Run the code above in your browser using DataLab