Skip to contents

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 class 'TimeIntervals'
precedes(x, ...)

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

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

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

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

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

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

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

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

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

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

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

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

Arguments

x

A TimeIntervals object.

...

Currently not used.

Value

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

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.

RelationConverse
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 ===

References

Allen, J. F. (1983). Maintaining Knowledge about Temporal Intervals. Communications of the ACM, 26(11): 832-843. 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()

Author

N. Frerebeau

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...
#>       [,1] [,2]
#>  [1,] "A"  "E" 
#>  [2,] "A"  "F" 
#>  [3,] "A"  "G" 
#>  [4,] "B"  "D" 
#>  [5,] "B"  "E" 
#>  [6,] "B"  "F" 
#>  [7,] "B"  "G" 
#>  [8,] "C"  "G" 
#>  [9,] "D"  "G" 
#> [10,] "E"  "F" 
#> [11,] "E"  "G" 

overlaps(int) # A overlaps C...
#>      [,1] [,2]
#> [1,] "A"  "C" 
#> [2,] "A"  "D" 
#> [3,] "B"  "C" 
#> [4,] "C"  "F" 
#> [5,] "D"  "F" 
#> [6,] "F"  "G" 

contains(int) # A contains B...
#>      [,1] [,2]
#> [1,] "A"  "B" 
#> [2,] "C"  "D" 
#> [3,] "C"  "E" 
#> [4,] "D"  "E"