Learn R Programming

amber (version 1.0.3)

intFun.anom.mly: Monthly anomalies

Description

This function computes monthly anomalies.

Usage

intFun.anom.mly(mly, clim)

Arguments

mly

An R object with a monthly time series

clim

An R object with climatological monthly mean data

Value

A raster object with monthly anomalies

Examples

Run this code
# NOT RUN {
# make some data
month <- seq(1,12,1)
month <- rep(month,10)
mod <- runif(length(month), 0,10)
mod <- data.frame(month, mod)
# make an index
index <- list(mod$month)
clim.mly <- apply(mod, 2, function(x) {tapply(x, index, mean, na.rm=TRUE)})
mod.anom <- intFun.anom.mly(mod, clim.mly)

# }

Run the code above in your browser using DataLab