apply.monthly {rts} | R Documentation |
Apply a function over calendar periods
Description
Apply a specified function to each distinct period in a given raster time series object.
Usage
apply.daily(x, FUN, ...)
apply.weekly(x, FUN, ...)
apply.monthly(x, FUN, ...)
apply.quarterly(x, FUN, ...)
apply.yearly(x, FUN, ...)
Arguments
x |
a raster time series ( |
FUN |
an R function |
... |
additional arguments to FUN |
Details
These functions offer Simple mechanism to apply a function to non-overlapping time periods, e.g. weekly, monthly, etc, and return a raster time series object including a raster layer for each period in the original data, produced by FUN
. The end of each period of time is assigned to the corresponding raster layer in the output.
Value
A raster time series (Raster*TS
) object
Author(s)
Babak Naimi
See Also
Examples
## Not run:
file <- system.file("external/ndvi", package="rts")
ndvi <- rts(file) # read the ndvi time series from the specified file
ndvi
ndvi.y <- apply.yearly(ndvi, mean) # apply mean function for each year
ndvi.y
ndvi.q <- apply.quarterly(ndvi,sd) # apply sd function for each quarter of years
ndvi.q
## End(Not run)
[Package rts version 1.1-14 Index]