Learn R Programming

tooth

tooth is an R package for dental public health research. It computes standardised caries indices and produces publication-ready odontogram heatmaps from clinical examination data.

An odontogram is a whole-mouth dental chart that arranges every tooth in its anatomical position across the four quadrants. tooth renders each tooth as a five-surface crown diagram with optional root-surface bars, then maps your surface values onto a colour gradient — so caries patterns, treatment outcomes, or any per-tooth-surface metric are visible at a glance across the whole arch.

Crown surfaces

AbbreviationSurfaceDescription
BBuccalCheek-facing surface
LLingualTongue-facing surface
MMesialForward-facing interproximal surface
DDistalBackward-facing interproximal surface
OOcclusalBiting/chewing surface

Root surfaces

AbbreviationSurfaceDescription
RBRoot-BuccalRoot surface on the cheek side
RLRoot-LingualRoot surface on the tongue side
RMRoot-MesialRoot surface on the mesial side
RDRoot-DistalRoot surface on the distal side

Why tooth?

Dental epidemiological studies routinely compute DMFT/DMFS indices and visualise caries distributions, yet there is no dedicated R package for these tasks. Researchers write ad-hoc scripts with hardcoded ICDAS thresholds and manual ggplot layouts for every new project. tooth replaces those one-off scripts with tested, documented, flexible functions that work across study designs — primary or permanent dentition, 5 to 8 teeth per quadrant, coronal and root caries, long or wide data formats.

Features

  • Caries indices — DMFT/dmft and DMFS/dmfs with configurable ICDAS thresholds, activity codes, and restoration codes
  • Root vs coronal separation — Tally root caries (RDT, RDS) independently from coronal indices
  • Odontogram heatmaps — Colour-coded whole-arch dental charts with up to 9 surfaces per tooth (B, L, M, D, O, RB, RL, RM, RD)
  • Flexible dentition — Primary (5 teeth/quadrant) or permanent (5–8 teeth/quadrant)
  • Stratification with statistics — Facet by treatment arm with sample size (n), mean DMFT, mean DT, and significance stars (t-test or Wilcoxon rank-sum)
  • Tooth numbering — Display in quadrant, FDI (ISO 3950), or Universal (ADA) notation
  • Manual heatmap rangemin_val/max_val for consistent colour scales across multiple plots
  • Surface label toggleshow_labels = FALSE for clean exports
  • Adjustable tooth label sizetooth_label_size for readability
  • Custom strata titlesstrata_labels to rename panel headings
  • Footnotes — Abbreviation keys and p-value definitions via footnote
  • Smart spacing — Automatically widens tooth gaps when root-mesial (RM) and root-distal (RD) surfaces are displayed
  • Long or wide input — Auto-pivots wide-format data to long
  • Tooth numbering conversion — FDI ↔ Universal ↔ quadrant

Installation

# From GitHub
devtools::install_github("ddmsel/tooth")

# From local tarball
install.packages("tooth_0.5.0.tar.gz", repos = NULL, type = "source")

Gallery

Single tooth diagram

Each tooth is a five-wedge crown (B, L, M, D, O) with optional root bars (RB, RL), labelled by surface and coloured by value.

Coronal odontogram — full arch

build_odontogram(
  data = decay_data,
  teeth_per_quadrant = 7,
  surfaces = c("buc", "lin", "mes", "dis", "occ")
)

Odontogram with root-buccal (RB) and root-lingual (RL) surfaces

build_odontogram(
  data = decay_data,
  surfaces = c("buc", "lin", "mes", "dis", "occ", "rootb", "rootl")
)

Stratified odontogram with summary statistics

stats_df <- data.frame(
  treatment = c("SDF", "ART"),
  n = c(120, 115),
  mean_DT = c(2.3, 2.8),
  mean_DMFT = c(5.1, 5.6)
)

build_odontogram(
  data = decay_by_trt,
  strata = "treatment",
  stats = stats_df,
  footnote = "B=Buccal, L=Lingual, M=Mesial, D=Distal, O=Occlusal.\n* p<0.05, ** p<0.01, *** p<0.001."
)

Odontogram with FDI numbering

build_odontogram(data = decay_data, numbering = "fdi")

Odontogram without surface labels

build_odontogram(data = decay_data, show_labels = FALSE)

Quick Start

DMFT calculation

library(tooth)
data(sim_exam)

# Basic DMFT
dmft <- calc_dmft(sim_exam)

# With stratification
dmft <- calc_dmft(sim_exam, strata = "treatment")

# Separate root caries
dmft <- calc_dmft(sim_exam, root_lesion_col = "lesion_code")
# Returns DT (coronal) + RDT (root) separately

Odontogram with all options

build_odontogram(
  data             = decay_data,
  value_col        = "prop",
  teeth_per_quadrant = 7,
  title            = "Caries Distribution",
  surfaces         = c("buc", "lin", "mes", "dis", "occ"),
  show_labels      = TRUE,
  tooth_label_size = 3,
  numbering        = "fdi",
  min_val = 0, max_val = 0.5,
  strata           = "treatment",
  strata_labels    = c("1" = "SDF", "2" = "ART + FV"),
  stats            = stats_df,
  stats_test       = "wilcox",
  stats_var        = "mean_DMFT",
  stats_raw        = raw_patient_data,
  footnote         = paste0(
    "B=Buccal, L=Lingual, M=Mesial, D=Distal, O=Occlusal.\n",
    "* p<0.05, ** p<0.01, *** p<0.001 (Wilcoxon rank-sum test)."
  )
)

Tooth numbering conversion

tooth_convert("11", from = "fdi", to = "quadrant")
#> "ur1"

tooth_convert("ur1", from = "quadrant", to = "fdi")
#> "11"

All Functions

FunctionDescription
build_odontogram()Full-arch heatmap with stratification, stats, numbering
draw_tooth()Single tooth polygon geometry (up to 9 surfaces)
calc_dmft()DMFT/dmft with root/coronal separation
calc_dmfs()DMFS/dmfs with root/coronal separation
pivot_to_long()Wide → long format converter
tooth_config()Arch layout configuration
tooth_convert()FDI ↔ Universal ↔ quadrant numbering

Authors

  • David Selvaraj, MBA, PhDauthor, maintainer Department of Community Dentistry, Case Western Reserve University School of Dental Medicine, Cleveland, OH. dms256@case.edu · ORCID: 0000-0003-4055-9493

  • Suchitra Nelson, PhDauthor Department of Community Dentistry, Case Western Reserve University School of Dental Medicine, Cleveland, OH; and Department of Population and Quantitative Health Sciences, Case Western Reserve University School of Medicine, Cleveland, OH.

Citation

If you use tooth in published research, please cite:

Selvaraj D, Nelson S (2026). tooth: Dental Public Health Indices and
Odontogram Visualizations. R package version 0.5.0.
https://github.com/ddmsel/tooth

License

MIT

Copy Link

Version

Install

install.packages('tooth')

Version

0.5.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

David Selvaraj

Last Published

July 22nd, 2026

Functions in tooth (0.5.0)

draw_tooth

Draw a single tooth as polygon geometry
calc_dmft

Calculate DMFT / dmft index from surface- or tooth-level data
tooth-package

tooth: Dental Public Health Indices and Odontogram Visualizations
build_odontogram

Build a surface-level odontogram heatmap
pivot_to_long

Pivot wide tooth data to long format
summarise_dmft

Summarise DMFT results by group
tooth_config

Generate tooth configuration for an arch
calc_dmfs

Calculate DMFS / dmfs index from surface-level data
tooth_convert

Convert between tooth numbering systems
sim_exam

Simulated dental examination data
tooth-deprecated

Deprecated functions in tooth