dbplot_boxplot: Boxplot

View source: R/boxplot.R

dbplot_boxplotR Documentation

Boxplot

Description

Uses dplyr operations to aggregate data and then 'ggplot2' to create the boxplot. Because of this approach, the calculations automatically run inside the database if 'data' has a database or sparklyr connection. The 'class()' of such tables in R are: tbl_sql, tbl_dbi, tbl_spark

Requires database support for percentile/quantile functions. See db_compute_boxplot for supported database backends.

Usage

dbplot_boxplot(data, x, var, coef = 1.5)

Arguments

data

A table (tbl)

x

A discrete variable in which to group the boxplots

var

A continuous variable

coef

Length of the whiskers as multiple of IQR. Defaults to 1.5

Value

A ggplot object displaying boxplots for the specified variable grouped by x.

See Also

dbplot_bar, dbplot_line , dbplot_raster, dbplot_histogram

Examples

## Not run: 
library(DBI)
library(dplyr)
library(ggplot2)
con <- dbConnect(duckdb::duckdb(), ":memory:")
db_mtcars <- copy_to(con, mtcars, "mtcars")

db_mtcars |>
  dbplot_boxplot(am, mpg)

dbDisconnect(con)

## End(Not run)


dbplot documentation built on March 13, 2026, 5:06 p.m.