bubblebath {circles} | R Documentation |
Generate Bubble Bath (Chart) Dataframe
Description
Creates a dataset of circles ("bubbles") with random centers and specified radii. When overlap is FALSE, circles are placed so they do not overlap.
Usage
bubblebath(
frameSize = c(50, 50),
circSize = seq(0.2, 5, length.out = 25),
maxCircsPerRad = 10000,
max_iter = 10000,
density = 0.7,
overlap = FALSE,
suppressWarning = FALSE
)
Arguments
frameSize |
A numeric vector of length 2 defining the frame's width and height (centered at 0). |
circSize |
A numeric vector specifying the radii of circles to place. If length is 2, it's interpreted as min and max for a sequence. If length > 2, the exact values are used as radii. |
maxCircsPerRad |
Maximum number of circles per radius. |
max_iter |
Maximum attempts to place each circle. |
density |
Density of circles, between 0 and 1. |
overlap |
Logical; if FALSE, circles won't overlap. |
suppressWarning |
Logical; if TRUE internal warnings are suppressed. |
Value
A data frame with columns x, y, and r (circle centers and radii).
Examples
# Create bubble bath points
circles <- bubblebath(circSize = c(0.5, 1, 2, 3), overlap = FALSE)
[Package circles version 0.1.0 Index]