relations: Temporal Relations

relationsR Documentation

Temporal Relations

Description

Test for the logical relation between time intervals according to Allen's typology.

Usage

precedes(x, ...)

preceded_by(x, ...)

meets(x, ...)

met_by(x, ...)

overlaps(x, ...)

overlapped_by(x, ...)

finishes(x, ...)

finished_by(x, ...)

contains(x, ...)

during(x, ...)

starts(x, ...)

started_by(x, ...)

equals(x, ...)

## S4 method for signature 'TimeIntervals'
precedes(x, ...)

## S4 method for signature 'TimeIntervals'
preceded_by(x, ...)

## S4 method for signature 'TimeIntervals'
meets(x, ...)

## S4 method for signature 'TimeIntervals'
met_by(x, ...)

## S4 method for signature 'TimeIntervals'
overlaps(x, ...)

## S4 method for signature 'TimeIntervals'
overlapped_by(x, ...)

## S4 method for signature 'TimeIntervals'
finishes(x, ...)

## S4 method for signature 'TimeIntervals'
finished_by(x, ...)

## S4 method for signature 'TimeIntervals'
contains(x, ...)

## S4 method for signature 'TimeIntervals'
during(x, ...)

## S4 method for signature 'TimeIntervals'
starts(x, ...)

## S4 method for signature 'TimeIntervals'
started_by(x, ...)

## S4 method for signature 'TimeIntervals'
equals(x, ...)

Arguments

x

A TimeIntervals object.

...

Currently not used.

Details

Allen (1983) proposed thirteen basic relations between time intervals that are (Alspaugh 2019):

  • Distinct: no pair of definite intervals can be related by more than one of the relationships.

  • Exhaustive: any pair of definite intervals are described by one of the relations.

  • Qualitative: no numeric time spans are considered.

Relation Converse
precedes (p) (P) preceded by
meets (m) (M) met by
overlaps (o) (O) overlapped by
finished by (F) (f) finishes
contains (D) (d) during
starts (s) (S) started by
equals (e)

A precedes B

A ===
B     ===

A preceded by B

A     ===
B ===

A meets B

A ===
B    ===

A met by B

A ===
B    ===

A overlaps B

A ===
B   ===

A overlapped by B

A   ===
B ===

A finished by B

A =====
B   ===

A finishes B

A   ===
B =====

A contains B

A =====
B  ===

A during B

A  ===
B =====

A starts B

A ===
B =====

A started by B

A =====
B ===

A equals B

A ===
B ===

Value

A two-columns matrix where each row specifies one relation.

Author(s)

N. Frerebeau

References

Allen, J. F. (1983). Maintaining Knowledge about Temporal Intervals. Communications of the ACM, 26(11): 832-843. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1145/182.358434")}.

Alspaugh, T. (2019). Allen's Interval Algebra. URL: https://thomasalspaugh.org/pub/fnd/allen.html.

See Also

Other temporal relations: overlap()

Examples

## Seven intervals
int <- intervals(
  start = c(1, 2, 3, 6, 9, 13, 17),
  end = c(7, 4, 15, 14, 11, 18, 19),
  calendar = CE(),
  names = c("A", "B", "C", "D", "E", "F", "G")
)

## Plot intervals
plot(int)

## Temporal relations
precedes(int) # A precedes E...

overlaps(int) # A overlaps C...

contains(int) # A contains B...

aion documentation built on Nov. 5, 2025, 6:03 p.m.