Package 'teethr'

Title: Working with dental data
Description: A package to facilitate working with dental data and calculation of dental indices that are commonly used in dental anthropology.
Authors: Bjørn Peare Bartholdy [aut, cre] (ORCID: <https://orcid.org/0000-0003-3985-1016>)
Maintainer: Bjørn Peare Bartholdy <[email protected]>
License: MIT + file LICENSE
Version: 0.0.0.9000
Built: 2026-09-23 07:34:24 UTC
Source: https://codeberg.org/bbartholdy/teethr

Help Index


Calculate calculus index

Description

Convenience function to calculate dental calculus index directly from a dental_longer() output.

Usage

calculus_index(.data, ..., .score = score, .method = c("simple", "greene2005"))

Arguments

.data

Data frame in long format, with one tooth surface per row, and one calculus score per surface.

...

can be used to add arguments to group_by. By default .add = T.

.score

numeric. Calculus score for each surface. Defaults to 'score' as provided by dental_longer.

.method

string. Using .method = "greene2005" will apply dental_filter() and add quadrant to grouping variables (according to Greene et al. (2005)). .method = "simple" (default) just takes user input and no filter.

Details

Calculate the calculus index for each quadrant of an individual based on the method outlined in Greene et al. (2005). The original method calculates a score for each quadrant of the dentition, so it is recommended to group by quadrant, either in the function or using group_by above in a pipe (see examples).

Value

The default returns a data frame with the supplied groups and calculations for number of surfaces scored, number of teeth scored, sum of scores, and the calculus index.

Source

Greene, T.R., Kuba, C.L., Irish, J.D. 2005. Quantifying calculus: A suggested new approach for recording an important indicator of diet and dental health. doi:10.1016/j.jchb.2005.02.002

Examples

library(dplyr)
mb11_calculus_long <- mb11_calculus %>%
  dental_longer(-id, names_sep = "_") %>%
  dental_join()
# example adding groups before call to function
mb11_calculus_long %>%
  group_by(id, quadrant) %>%
  calculus_index()

# example adding groups in call to function
mb11_calculus_long %>%
  calculus_index(id, quadrant)

# example of the Greene et al. 2005 method
mb11_calculus_long %>%
  calculus_index(.method = "greene2005")

Convert caries scores to lesion counts

Description

Convert caries scores to lesion counts

Usage

count_caries(
  data,
  caries = score,
  no_lesion = NULL,
  lesion_sep = NULL,
  unobs = NA,
  method = c("location", "standards", "count")
)

Arguments

data

data frame containing caries scores

caries

column containing caries scores

no_lesion

value used to indicate no caries lesions

lesion_sep

string. character used to separate multiple lesions.

unobs

value used to indicate unobservable

method

string. what method was used to score caries lesions.


Dental arcade mapping data

Description

Used to map each tooth to geom_sf() to create a dental plot.

Usage

dental_arcade_mapping

Format

dental_arcade_mapping

A data frame with 32 rows and 2 columns:

tooth

string. Tooth with text notation.

geometry

sfc. Simple feature geometry list-column for mapping teeth to geom_sf().

...

Source

https://github.com/ZandraFagernas/dental_arcade/blob/v0.1/dental_arcade_empty_mapping.jpg


Dentition filter

Description

Checks if the data frame satisfies the criterion that minimally, each surface must be scorable on at least one side of the dentition to obtain the index, then filters out groups that don't satisfy.

Usage

dental_filter(data, score = score)

Arguments

data

long format data frame with tooth position information and either lesion counts or scores.

score

Scores of a dental lesion (e.g. caries counts or dental calculus score).

Value

Returns a filtered data frame and a warning if any rows were removed.


Produce detailed tooth position information from tooth notation

Description

Produce detailed tooth position information from tooth notation

Usage

dental_join(data, by = tooth, notation = c("FDI", "standards", "text"), ...)

Arguments

data

A data frame containing a column with a unique identifier and one column per tooth or tooth surface.

by

string. name of column containing the tooth notation.

notation

string. Which notation convention is used to name the columns with dental scores. Options are "FDI", "standards", "text". See the tooth_notation object for more details.

...

supply additional arguments to left_join()

Value

Returns the original data frame along with detailed information about the tooth including, region (maxilla, mandible), position (anterior, posterior), side, class (incisor, canine, etc.), type, (first incisor, second molar, etc.), and quadrant.

Examples

mb11_caries %>%
  dental_longer(-id) %>%
  dental_join()

Convert a data frame containing dental scores to long format and add tooth position variables.

Description

This function is a wrapper for pivot_longer() that converts a wide format data frame to a long format with tooth names in a tooth column (and surface, if applicable) and the score in a score column. It also attaches additional columns with information about the type of tooth and the position of the tooth in the mouth (type, class, region, etc.).

Usage

dental_longer(data, cols, ...)

Arguments

data

A data frame containing a column with a unique identifier and one column per tooth or tooth surface.

cols

Which columns to pivot into longer format. These should be the columns containing the scores for each tooth/surface.

...

additional arguments passed on to pivot_longer.

Details

If there are multiple columns per tooth, i.e., if teeth were scored per surface and variables are named something like _, names_sep = "_" (or whatever character was used to separate tooth number from tooth surface) should be passed to pivot_longer via .... If no such separator was used, use instead ⁠names_pattern = <regex>⁠. See pivot_longer for more details.

Value

Returns a longer data frame with one row per tooth or tooth surface, with columns for tooth number, region (maxilla, mandible), position (anterior, posterior), side, class (incisor, canine, etc.), type, and quadrant.

Examples

# pivot calculus scores per surface (all columns except id)
  # 't' prefix needs to be removed from column names
mb11_calculus %>%
  dental_longer(-id, names_sep = "_")

# pivot caries scores per tooth
mb11_caries %>%
  dental_longer(-id)

Recode tooth notation

Description

Function to switch between tooth notations.

Usage

dental_recode(data, col, from, to)

Arguments

data

A data frame to convert

col

the column to convert. Must contain a tooth notation (e.g., FDI, standards).

from

string. the tooth notation of the original data.

to

string. The tooth notation you wish to convert to.


Calculate a dental index or ratio

Description

Calculate a dental index, such as a calculus index, or ratio, such as caries ratio.

Usage

dental_index(data, score = score)

dental_ratio(data, count = count)

Arguments

data

long format data frame with tooth position information and either lesion counts or scores.

score

Scores of a dental lesion (e.g. caries counts or dental calculus score).

count

Counts of a dental lesion (e.g. caries counts or dental calculus score).

Details

Function to calculate the index or ratio of dental diseases. dental_ratio() is just a wrapper for dental_index() where the output column 'index' is changed to 'count', and 'score_sum' to 'ratio'.

Value

Returns a data frame containing the grouping variable(s), the number of teeth per group, the lesion count or sum of scores, and the calculated index or ratio.

Functions

  • dental_index(): calculate dental disease index

  • dental_ratio(): calculate dental disease ratio

Examples

library(dplyr)
library(tidyr)
# dental calculus index
mb11_calculus %>%
  dental_longer(-id, names_sep = "_") %>%
  dental_join() %>%
  group_by(class) %>% # calculate index per tooth class
  dental_index()

Middenbeemster dental calculus data

Description

Dental calculus scores collected from Middenbeemster (MB11), a rural 19th century archaeological site in the Netherlands.

Usage

mb11_calculus

Format

mb11_calculus

A data frame with 41 rows and 97 columns:

id

Skeletal ID

t11:t48_buc/lin/ipx

Calculus score per tooth surface. Variable naming: t<tooth number (FDI notation)>_. buc = buccal; lin = lingual, ipx = interproximal

...

Source

https://doi.org/10.5281/zenodo.7649151


Middenbeemster dental caries data

Description

Dental caries lesions collected from Middenbeemster (MB11), a rural 19th century archaeological site in the Netherlands.

Usage

mb11_caries

Format

mb11_caries

A data frame with 41 rows and 33 columns:

id

Skeletal ID

t11:t48

Caries lesion location(s) per tooth. Multiple scores separated by ';'. Variable naming: t<tooth number (FDI notation)>. mes = mesial, dis = distal, buc = buccal; lin = lingual, occ = occlusal, root = root, crown = large lesion of indeterminate origin

...

Source

https://doi.org/10.5281/zenodo.7649151


Middenbeemster sample demographics

Description

Age and sex of the individuals with dental calculus scored in mb11_calculus.

Usage

mb11_demography

Format

mb11_demography

A data frame with 41 rows and 97 columns:

id

Skeletal ID

age

Age category of the individual. eya = early young adult (18-24); lya = late young adult (25-34); ma = middle adult (35-49); old = old adult (50+).

sex

Biological sex of individual estimated using osteological methods. f = female; pf = probable female; pm = probable male; m = male.

...

Source

https://doi.org/10.5281/zenodo.7649151


Common naming schemes in dental anthropology

Description

Used to convert between tooth naming conventions that are common in dental anthropology.

Usage

tooth_notation

Format

tooth_notation

A data frame with 32 rows and 9 columns:

FDI

Fédération dentaire internationale naming convention

standards

Standards naming (Buikstra and Ubelaker 1994)

text

Text naming: [UL][LR][ICPM][1-3] = upper/lower; left/right; incisor/canine/premolar/molar; tooth type (1-4). Example: Upper left lateral incisor = ULI2

region

if the tooth is from the maxilla or mandible

position

if the tooth is anterior or posterior

side

if the tooth is from the left or right side

class

if the tooth is incisor, canine, premolar, or molar

type

if the tooth is central/lateral incisor, canine, first/second premolar, or first/second/third molar

quadrant

Which quadrant of the mouth the tooth is from. Upper/lower anterior/posterior.

...

Source

Buikstra, J. E., & Ubelaker, D. H. (1994). Standards for data collection from human skeletal remains. Arkansas Archaeological Survey Research Series No. 44. Fayetteville: Arkansas Archaeological Survey.