tempo provides a formal representation of intervals between two points in time (periods) and the potential logical relations between them in R.
Installation
You can install the development version of tempo from GitHub with the pak package:
pak::pak("joeroe/tempo")Usage
Create intervals from numeric start and end dates:
library("tempo")
#> Loading required package: era
#> Loading required package: rlang
#> Loading required package: vctrs
#> Loading required package: zeallot
intv1 <- interval(1500, 1900)
intv2 <- interval(1800, 1950)Or from numeric dates with an era label:
interval(1200, 800, "BCE")
#> <interval[1]>
#> [1] 1200–800 BCETest whether two intervals are contemporary with each other:
contemporary_with(intv1, intv2)
#> [1] TRUEtempo supports fifteen types of temporal relations following Levy’s typology (Levy et al. 2021; Levy 2025). See ?relations for a list.
By default, comparison of start and end points is inclusive (i.e. using >= and <=). strict = TRUE enables the ‘strict’ variants of each relation (i.e. using > and <):
intv3 <- interval(1900, 1950)
contemporary_with(intv1, intv3)
#> [1] TRUE
contemporary_with(intv1, intv3, strict = TRUE)
#> [1] FALSEReferences
Levy, E. 2025. “Temporal Relations in Archaeology: A Survey and a New Typology.” Archaeometry 67 (S1): 178–99. https://doi.org/10.1111/arcm.13080.
Levy, E., G. Geeraerts, F. Pluquet, E. Piasetzky, and A. Fantalkin. 2021. “Chronological Networks in Archaeology: A Formalised Scheme.” Journal of Archaeological Science 127: 105225. https://doi.org/10.1016/j.jas.2020.105225.