Skip to contents

An Interval is elapsed time in seconds between two specific years.

Usage

intervals(start, end, calendar, ...)

# S4 method for class 'RataDie,RataDie,missing'
intervals(start, end, names = NULL)

# S4 method for class 'numeric,numeric,TimeScale'
intervals(start, end, calendar, scale = 1, names = NULL)

Arguments

start

A numeric vector of (decimal) years or a RataDie object (see fixed()) giving the beginning of the time intervals.

end

A numeric vector of (decimal) years or a RataDie object (see fixed()) giving the end of the time intervals.

calendar

A TimeScale object specifying the calendar of time (see calendar()). If missing, time must be a RataDie object.

...

Currently not used.

names

A character string specifying the names of the time series.

scale

A length-one numeric vector specifying the number of years represented by one unit. It should be a power of 10 (i.e. 1000 means ka).

Value

A TimeIntervals object.

Author

N. Frerebeau

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())
#>      I1  I2 I3 I4 I5  I6  I7  I8 I9 I10 I11 I12 I13 I14 I15
#> I1  125  51  0  0  0  76   0   0  0   0   0   0   0   0   0
#> I2   51 125  0  0  0   1   0   0  0   0   0   0   0   0   0
#> I3    0   0 50 26  1   0  51  51  0   0  51   0   0   0   0
#> I4    0   0 26 50 26   0  51  51  0   0  51   0   0   1   0
#> I5    0   0  1 26 75   0  51  76  1   0  51  26   0  51   1
#> I6   76   1  0  0  0 200   0   0  0   0   0   0   0   0   0
#> I7    0   0 51 51 51   0 300 101  0   0 101   1   0  26   0
#> I8    0   0 51 51 76   0 101 125  1   0 101  26   0  51   1
#> I9    0   0  0  0  1   0   0   1 75  26   0  51  26   1  76
#> I10   0   0  0  0  0   0   0   0 26 125   0   1 126   0  51
#> I11   0   0 51 51 51   0 101 101  0   0 100   1   0  26   0
#> I12   0   0  0  0 26   0   1  26 51   1   1  75   1  26  51
#> I13   0   0  0  0  0   0   0   0 26 126   0   1 125   0  51
#> I14   0   0  0  1 51   0  26  51  1   0  26  26   0  50   1
#> I15   0   0  0  0  1   0   0   1 76  51   0  51  51   1 100