Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

calendar-endpoints

Endpoints Indexes


Description

Returns endpoint indexes from a 'timeDate' object

Usage

.endpoints(x, on = c("months", "years", "quarters", "weeks", "days",
    "hours", "minutes", "seconds"), k=1)

Arguments

x

a timeDate object.

on

the periods endpoints to find as a character string. Select from: "months", "years", "quarters", "weeks", "days", "hours", "minutes", "seconds".

k

along every k-th element.

Details

endpoints returns an integer vector corresponding to the last observation in each period specified by on, with a zero added to the beginning of the vector, and the index of the last observation in x at the end.

Value

returns an intege vector of endpoints beginning with 0 and ending with the a value equal to the length of the x argument.

Author(s)

Jeff Ryan, modofied by Diethelm Wuertz for timeDate objects.

Examples

## endpoints -

   # Weekly Endpoints:
   .endpoints(timeCalendar(), on="w")

timeDate

Rmetrics - Chronological and Calendar Objects

v3043.102
GPL (>= 2)
Authors
Diethelm Wuertz [aut], Tobias Setz [cre], Yohan Chalabi [ctb], Martin Maechler [ctb], Joe W. Byers [ctb]
Initial release
2018-02-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.