Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

apply.monthly

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 (Raster*TS) object, created by rts

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)

rts

Raster Time Series Analysis

v1.0-49
GPL (>= 3)
Authors
Babak Naimi
Initial release
2019-02-01

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.