endpoints: Locate endpoints by time

Description Usage Arguments Details Value Note Author(s) See Also Examples

Description

Extract index values of a given Raster*TS object corresponding to the last observations given a period specified by on.

Usage

1
endpoints(x, on="months", k=1)

Arguments

x

a raster time series (Raster*TS) object created by rts

on

the periods endpoints to find as a character string

k

along every k-th element - see notes

Details

This function is, indeed, endpoints in xts that works with Raster*TS objects. It 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 raster in 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”, and “years”.

Value

A numeric vector of endpoints beginning with 0 and ending with a value equal to the number of raster layers in the x argument.

Note

Windows support for subsecond periods is not supported.

Author(s)

Babak Naimi

[email protected]

http://r-gis.net

See Also

endpoints

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
file <- system.file("external/ndvi", package="rts")

ndvi <- rts(file) # read the ndvi time series from the specified file

endpoints(ndvi,"years")

endpoints(ndvi,"quarters")

## End(Not run)

rts documentation built on Feb. 4, 2019, 1:04 a.m.