apply.monthly: Apply a function over calendar periods

apply.monthlyR 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 (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

naimi.b@gmail.com

https://r-gis.net/

See Also

endpoints, period.apply,

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 documentation built on Oct. 1, 2023, 9:07 a.m.

Related to apply.monthly in rts...