Learn R Programming

remote (version 1.2.3)

deseason: Create seasonal anomalies

Description

The function calculates anomalies of a RasterStack by supplying a suitable seasonal window. E. g. to create monthly anomalies of a raster stack of 12 layers per year, use cycle.window = 12.

Usage

# S4 method for RasterStackBrick
deseason(x, cycle.window = 12L, use.cpp = FALSE, filename = "", ...)

# S4 method for numeric deseason(x, cycle.window = 12L)

Value

If x is a Raster* object, a deseasoned RasterStack; else a deseasoned numeric vector.

Arguments

x

An Raster* object or, alternatively, a numeric time series.

cycle.window

integer, defaults to 12. The window for the creation of the anomalies.

use.cpp

logical, defaults to FALSE. Determines whether or not to use Rcpp functionality. Only applies if x is a Raster* object.

filename

character. Output filename (optional).

...

Additional arguments passed on to raster::writeRaster(), only considered if filename is specified.

See Also

anomalize(), denoise()

Examples

Run this code
data("australiaGPCP")

aus_dsn <- deseason(australiaGPCP, 12)

opar <- par(mfrow = c(1,2))
plot(australiaGPCP[[1]], main = "original")
plot(aus_dsn[[1]], main = "deseasoned")
par(opar)

Run the code above in your browser using DataLab