timeDate (version 4032.109)

.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)

Value

an integer vector of endpoints beginning with 0 and ending with the value equal to the length of the x argument

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.

Author

Jeff Ryan, modified by Diethelm Wuertz for "timeDate" objects.

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.

Examples

Run this code
## endpoints -

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

Run the code above in your browser using DataLab