Descriptive Statistics Graphics and Utilities
Version 0.0.0.927 · License GPL (≥ 2)
aurora is the graphics package of the DescToolsX ecosystem. It provides
a comprehensive collection of statistical plots, geometric drawing primitives,
color tools, annotation helpers, and formatting utilities — all built directly
on base R graphics.
Building on base graphics keeps the package lightweight and fully compatible
with everything base R offers (layout(), par(), custom devices), while a
central theme system and consistent argument conventions remove the usual
boilerplate: sensible defaults, automatic margin handling, and uniform
styling across all plot functions.
aurora is part of the DescToolsX package suite:
| Package | Role |
|---|---|
bedrock |
core infrastructure and utilities |
aurora |
graphics and visualization (this package) |
lumen |
statistical tests and confidence intervals |
alloy |
model fitting and evaluation |
hermes |
reporting and output |
# development version from GitHub
remotes::install_github("AndriSignorell/aurora")A large family of high-level plot*() functions with a consistent
interface (formula support, grouped variants, theme-driven styling):
- Distributions:
plotDens(),plotDens2D(),plotDensBox(),plotViolin(),plotRidge(),plotBox(),plotECDF(),plotFdist(),plotQQ(),plotProbDist() - Categorical data:
plotBar(),plotDot(),plotMosaic(),plotCatDist(),plotTreemap(),plotWeb() - Relationships:
plotXY(),plotLines(),plotCor(),plotAssoc(),plotBubble(),plotHexbin(),plotBag() - Special purpose:
plotTimeSeries(),plotArea(),plotMiss(),plotPropCI(),plotCirc(),plotPolar(),plotTernary(),plotBinaryTree(),plotFun()
Plot methods for objects from the suite are included, e.g.
plot.Desc.* (for desc() results), plot.Lc (Lorenz curves),
plot.BlandAltman, and lines() methods for lm and loess fits.
All plot functions draw their defaults from a central, replaceable theme:
getTheme() # inspect the active theme
setTheme(list(palette = "Set2")) # change one component globally
setTheme(list(grid = list(col = "grey90", lwd = 1, lty = "dotted")))
resetTheme() # back to the defaultExplicit arguments always override the theme at the call site; the theme in turn overrides the package defaults. One place to define the look — every plot follows.
Geometry follows a clean two-step design: constructors create geometry
objects — circle(), ellipse(), arc(), bezier(), band(), ring(),
regPolygon() — and an overloaded polygon() generic (fully compatible with
graphics::polygon()) draws them. canvas() provides a blank, aspect-true
plotting canvas, polarGrid() a polar coordinate system.
canvas()
polygon(circle(radius = 1), col = "lightblue")
polygon(regPolygon(radius = 0.7, numVertices = 5), border = "red")Because geometries are plain objects, they can be transformed before
drawing (rotate(), transformXY()) or combined into composite shapes.
- Manipulation:
addAlpha(),fade(),darken(),lighten(),mixColors(),grayscale(),colToOpaque() - Analysis:
contrastColor()(legible text colors on any background),findColor()(nearest named color) - Conversion: hex, RGB, HSV, CMY(K), and long integer representations
(
colToHex(),hexToRGB(),cmykToRgb(),rgbToLong(), …) - Palettes:
pal()andpalNames()for the suite's curated palettes
Utilities that handle the fiddly parts of base graphics:
stamp()— automatic plot stamping (author/date), theme-controlledboxedText(),barText(),textLegend(),colLegend()— labels and legends beyondtext()/legend()errBars(),shade(),splineCI(),band()— uncertainty displayaxisBreak(),axTicks(),titleRect(),lineSep()— axis and title furniturespreadOut()— de-overlapping label positionsisValidPlotRegion()— check the device geometry before drawing
fm()/fmCI()— flexible number and confidence interval formattingnotation(),style()— notation and style controlas.html(),toHtmlTable(),preview()— HTML rendering of tables and plots, e.g. for quick reports
- Coordinate transformations:
transformXY(),rotate(),degToRad(),lineToUser(),abcCoords() - Unit conversion engine:
convUnit()with SI and derived units - A complete
str*()family for string handling (strTrim(),strPad(),strAlign(),strExtract(),strDist(),strAbbr(), …)
library(aurora)
# grouped violin plot, styled by the active theme
plotViolin(mpg ~ cyl, data = mtcars)
# correlation matrix plot
plotCor(cor(mtcars))
# custom geometric graphic
canvas(main = "aurora primitives")
polygon(circle(radius = 1), col = addAlpha("steelblue", 0.4))
polygon(regPolygon(radius = 0.7, numVertices = 6), border = "red")- Base graphics, no grid — lightweight, transparent, hackable
- Consistent API — lowerCamelCase, uniform argument names and ordering across the whole suite
- Theme-driven — one place to define the look, every plot follows
- Robust by default — automatic margin adjustment, device geometry checks, protected graphics state
- Performance-aware — Rcpp under the hood where it matters
- Website: https://andrisignorell.github.io/aurora/
- Bug reports: https://github.com/AndriSignorell/aurora/issues
GPL (≥ 2)
