Locate Endpoints by Time
Extract index values of a given
xts object corresponding
to the last observations given a period specified by
endpoints(x, on="months", k=1)
an xts object
the periods endpoints to find as a character string
along every k-th element - see notes
endpoints returns a numeric 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
x at the end.
Valid values for the argument
on include: “us” (microseconds),
“microseconds”, “ms” (milliseconds),
“milliseconds”, “secs” (seconds),
“seconds”, “mins” (minutes), “minutes”,
“hours”, “days”, “weeks”, “months”, “quarters”,
A numeric vector of endpoints beginning with 0 and ending with the a value equal to the length of the x argument.
on periods are not supported on Windows.
Jeffrey A. Ryan
1 2 3 4
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.