50% off: Unlimited data and AI learning.
State of Data and AI Literacy Report 2025

balance (version 0.2.4)

balance.combine: Combine Two Sub-Plots

Description

This function combines the "partition" sub-plot with the "distribution" sub-plot, preserving scale.

Usage

balance.combine(balance.partition, balance.distribution, size = "first")

Arguments

balance.partition

A ggplot object. The "partition" sub-plot.

balance.distribution

A ggplot object. The "distribution" sub-plot.

size

A string. Toggles whether to size final figure based on "first" (partition) or "last" (distribution) figure provided.

Examples

Run this code
# NOT RUN {
library(balance)
data(iris)
x <- iris[,1:4]
sbp <- sbp.fromPBA(x)
res <- balance(x, sbp)
custom1 <- res[[1]] + ggplot2::theme_dark()
custom2 <- res[[2]] + ggplot2::theme_dark()
balance.combine(custom1, custom2)

# }

Run the code above in your browser using DataLab