start: Terminal Times

startR Documentation

Terminal Times

Description

Get the times the first and last observations were taken.

Usage

## S4 method for signature 'TimeSeries'
start(x, calendar = NULL, ...)

## S4 method for signature 'TimeIntervals'
start(x, calendar = NULL, ...)

## S4 method for signature 'TimeSeries'
end(x, calendar = NULL, ...)

## S4 method for signature 'TimeIntervals'
end(x, calendar = NULL, ...)

Arguments

x

A TimeSeries object.

calendar

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

...

Currently not used.

Value

A numeric vector of decimal years (if calendar is not NULL).

Author(s)

N. Frerebeau

See Also

Other tools: span(), time(), window()

Examples

## Create time-series of 20 observations

## Univariate
## Sampled every years starting from 1029 BCE
(X <- series(rnorm(30), time = 1029:1000, calendar = BCE()))

## Terminal and sampling times (returns rata die)
start(X)
end(X)
time(X)
span(X)

## Multivariate
## Sampled every century starting from 1000 CE
(Y <- series(matrix(rnorm(90), 30, 3), time = 1000:1029, calendar = CE()))

## Terminal and sampling times (returns Gregorian Common Era years)
start(Y, calendar = CE())
end(Y, calendar = CE())
time(Y, calendar = CE())
span(Y, calendar = CE())

## Coerce to data frame
df <- as.data.frame(Y, calendar = BP())
head(df)

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