apply.monthly | R Documentation |
Apply a specified function to each distinct period in a given raster time series object.
apply.daily(x, FUN, ...)
apply.weekly(x, FUN, ...)
apply.monthly(x, FUN, ...)
apply.quarterly(x, FUN, ...)
apply.yearly(x, FUN, ...)
x |
a raster time series ( |
FUN |
an R function |
... |
additional arguments to FUN |
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.
A raster time series (Raster*TS
) object
Babak Naimi
endpoints
, period.apply
,
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.