plot_continuous: Plot two continuous distributions

View source: R/plot_continuous.R

plot_continuousR Documentation

Plot two continuous distributions

Description

Plot two continuous distributions

Usage

plot_continuous(
  x,
  y,
  group_names = c("Group 1", "Group 2"),
  bins = 30,
  style = c("both", "hist", "density"),
  main = "Two-group raw distributions",
  xlab = "Value",
  ylab = "Density",
  col_x = rgb(0.2, 0.4, 0.8, 0.4),
  col_y = rgb(0.8, 0.2, 0.2, 0.4),
  line_col_x = "#2F5FB3",
  line_col_y = "#CC3333",
  lwd = 2,
  na_rm = TRUE,
  show_jsd = TRUE,
  jsd_digits = 3
)

Arguments

x

Numeric vector for group 1.

y

Numeric vector for group 2.

group_names

Group labels.

bins

Approximate number of histogram bins.

style

One of '"both"', '"hist"', or '"density"'.

main

Plot title.

xlab

X-axis label.

ylab

Y-axis label.

col_x

Fill color for group 1.

col_y

Fill color for group 2.

line_col_x

Line color for group 1 density.

line_col_y

Line color for group 2 density.

lwd

Line width for density curves.

na_rm

Logical; remove missing values?

show_jsd

Logical; whether to display JSD on the plot.

jsd_digits

Number of digits for displayed JSD.

Value

Invisibly returns plotting data.


jsdtools documentation built on March 31, 2026, 1:06 a.m.