| Title: | DicePlot Visualization for 'ggplot2' |
|---|---|
| Description: | Provides 'ggplot2' extensions for creating dice-based visualizations where each dot position represents a specific categorical variable. The package includes 'geom_dice()' for displaying presence/absence of categorical variables using traditional dice patterns. Each dice position (1-6) represents a different category, with dots shown only when that category is present. This allows intuitive visualization of up to 6 categorical variables simultaneously. |
| Authors: | Matthias Flotho [aut, cre] (ORCID: <https://orcid.org/0009-0006-4374-0801>) |
| Maintainer: | Matthias Flotho <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.2.0 |
| Built: | 2026-05-31 07:04:15 UTC |
| Source: | https://github.com/maflot/ggdiceplot |
Computes the (x, y) offset positions for drawing dots on dice faces.
make_offsets(n, width = 0.5, height = 0.5, pad = 0.1)make_offsets(n, width = 0.5, height = 0.5, pad = 0.1)
n |
Integer from 1 to 6, indicating the number of dots on the die face. |
width |
Total width of the die face (default: 0.5). |
height |
Total height of the die face (default: 0.5). |
pad |
Padding to apply around the dot grid (default: 0.1). |
A data.frame with key, x, and y columns indicating dot positions.
This toy dataset (sample_dice_data1) is used to demonstrate the geom_dice() function.
It simulates log fold-change (LFC) and adjusted p-values (q-values) for a range of
oral taxa across disease types and specimen sites.
data(sample_dice_data1)data(sample_dice_data1)
A data frame with 160 rows and 5 columns:
Character. Microbial taxon name (8 taxa).
Character. Disease condition (Caries, Periodontitis, Healthy, Gingivitis).
Character. Body site specimen (Saliva, Plaque, Tongue, Buccal, Gingival).
Numeric. Simulated log2 fold change value; may contain NA.
Numeric. Simulated adjusted p-value (q-value); may contain NA.
data(sample_dice_data1) head(sample_dice_data1)data(sample_dice_data1) head(sample_dice_data1)
sample_dice_data2 is a toy dataset designed to demonstrate geom_dice()
with multiple specimen types. It simulates log2 fold-change (LFC) and
adjusted p-values (q-values) for oral taxa across disease conditions and
specimen sites, with some missing values.
data(sample_dice_data2)data(sample_dice_data2)
A data frame with 160 rows and 5 columns:
Character. Microbial taxon name (8 taxa).
Character. Disease condition (Caries, Periodontitis, Healthy, Gingivitis).
Character. Body site specimen (Saliva, Plaque, Tongue, Buccal, Gingival).
Numeric. Simulated log2 fold change; may contain NA.
Numeric. Simulated adjusted p-value (q-value); may contain NA.
data(sample_dice_data2) head(sample_dice_data2)data(sample_dice_data2) head(sample_dice_data2)
sample_dice_large is a larger toy dataset with 60 taxa, designed to test
geom_dice() at higher density. It simulates log2 fold-change and q-values
with approximately 50\
data(sample_dice_large)data(sample_dice_large)
A data frame with 480 rows and 6 columns:
Character. Taxon name (Taxon_1 through Taxon_60).
Character. Disease condition (Caries, Periodontitis, Healthy, Gingivitis).
Character. Specimen type (Saliva, Plaque).
Integer. Replicate identifier.
Numeric. Simulated log2 fold change; may contain NA.
Numeric. Simulated adjusted p-value; may contain NA.
data(sample_dice_large) head(sample_dice_large)data(sample_dice_large) head(sample_dice_large)
sample_dice_miRNA is a toy dataset for demonstrating geom_dice() with
categorical fill mapping. It simulates miRNA dysregulation across compounds
and organs, with direction (Up, Down, Unchanged) as the fill variable.
data(sample_dice_miRNA)data(sample_dice_miRNA)
A data frame with approximately 90 rows and 5 columns:
Factor. miRNA identifier (miR-1 through miR-5).
Factor. Treatment compound (Control, Compound_1 through Compound_4).
Factor. Target organ (Lung, Liver, Brain, Kidney).
Numeric. Simulated log2 fold change.
Factor. Regulation direction (Down, Unchanged, Up).
data(sample_dice_miRNA) head(sample_dice_miRNA)data(sample_dice_miRNA) head(sample_dice_miRNA)
Creates a ggplot2 discrete scale for dice dot aesthetics.
scale_dots_discrete(..., aesthetics = "dots")scale_dots_discrete(..., aesthetics = "dots")
... |
Passed to |
aesthetics |
Character string of the target aesthetic (default: "dots") |
A ggplot2 scale
A minimal ggplot2 theme for dice plots.
theme_dice(x_length, y_length, ...)theme_dice(x_length, y_length, ...)
x_length |
Width of the plotting area (kept for compatibility) |
y_length |
Height of the plotting area (kept for compatibility) |
... |
Additional arguments passed to |
A ggplot2 theme