Skip to content
/ tempo Public

Chronological Intervals and Temporal Relations

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

joeroe/tempo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tempo

CRAN status Lifecycle: experimental R-CMD-check Codecov test coverage

tempo is an R package that provides a formal representation of intervals between two points in time (periods) and the potential logical relations between them.

Installation

You can install the development version of tempo from GitHub with the remotes package:

remotes::install_github("joeroe/tempo")

Example

Test whether two periods, specified as numeric vectors of start and end dates, are contemporary with each other:

library("tempo")
#> Loading required package: rlang

period1 <- c(1500, 1900)
period2 <- c(1800, 1950)

contemporary_with(period1, period2)
#> [1] TRUE

tempo supports fifteen types of temporal relations following Levy’s typology (Levy et al. 2021 https://doi.org/10.1016/j.jas.2020.105225; Levy et al. in press). 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 <):

period3 <- c(1900, 1950)

contemporary_with(period1, period3)
#> [1] TRUE

contemporary_with(period1, period3, strict = TRUE)
#> [1] FALSE

About

Chronological Intervals and Temporal Relations

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages