Terminal times and range
base-start.Rd
Extracts the time when the first or last observation was taken, or
computes the range of the dates in a "timeDate"
object.
Arguments
- x
an object of class
"timeDate"
.- ...
ignored by
start
andend
; a 'timeDate' object formin
,max
, andrange
.- na.rm
not used.
Details
Conceptually, the "timeDate"
object is sorted before the
computations. In particular, start
is not necessarilly the
first element of the object and similarly for the other functions.
min
and max
are equivalent to start
end
end
, respectively.
range
returns the earlies and the latest times in a
"timeDate"
object. The remaining functions return only one of
them, as suggested by their names.
Examples
## timeCalendar -
# Random Calendar Dates:
set.seed(1234)
tR = sample(timeCalendar())
sort(tR)
#> GMT
#> [1] [2023-01-01] [2023-02-01] [2023-03-01] [2023-04-01] [2023-05-01]
#> [6] [2023-06-01] [2023-07-01] [2023-08-01] [2023-09-01] [2023-10-01]
#> [11] [2023-11-01] [2023-12-01]
tR
#> GMT
#> [1] [2023-12-01] [2023-10-01] [2023-06-01] [2023-05-01] [2023-04-01]
#> [6] [2023-07-01] [2023-01-01] [2023-09-01] [2023-02-01] [2023-08-01]
#> [11] [2023-11-01] [2023-03-01]
## start | end -
start(tR)
#> GMT
#> [1] [2023-01-01]
end(tR)
#> GMT
#> [1] [2023-12-01]
## The First and Last Time Stamp:
tR[1]
#> GMT
#> [1] [2023-12-01]
tR[length(tR)]
#> GMT
#> [1] [2023-03-01]
rev(tR)[1]
#> GMT
#> [1] [2023-03-01]
## The Range:
c(start(tR), end(tR))
#> GMT
#> [1] [2023-01-01] [2023-12-01]
range(tR)
#> GMT
#> [1] [2023-01-01] [2023-12-01]