overlap: Time Overlap

overlapR Documentation

Time Overlap

Description

Computes the length of overlap of time intervals.

Usage

overlap(x, ...)

## S4 method for signature 'TimeIntervals'
overlap(x, calendar = NULL, aggregate = TRUE)

Arguments

x

A TimeIntervals object.

...

Currently not used.

calendar

A TimeScale object specifying the target calendar (see calendar()). If NULL (the default), rata die are returned.

aggregate

A logical scalar: should disjoint intervals referring to the same event be aggregated?

Details

The overlap of two time intervals is a difference between the minimum value of the two upper boundaries and the maximum value of the two lower boundaries, plus 1.

Value

A symmetric numeric matrix of years.

Author(s)

N. Frerebeau

See Also

Other chronological reasoning tools: as_graph()

Examples

## Create time intervals
int <- intervals(
  start = c(625, 700, 1200, 1225, 1250, 500, 1000, 1200,
            1325, 1375, 1200, 1300, 1375, 1275, 1325),
  end = c(750, 825, 1250, 1275, 1325, 700, 1300, 1325,
          1400, 1500, 1300, 1375, 1500, 1325, 1425),
  calendar = CE()
)

## Plot intervals
plot(int) # Default calendar

## Overlap
overlap(int, calendar = CE())

aion documentation built on April 4, 2025, 1:53 a.m.