intFun.grid.phase: Time distance in months

Description Usage Arguments Value Examples

View source: R/intFun.R

Description

Consider two rasters that show the month of the maximum value of a variable during the climatological mean annual cycle. Calculating the absolute difference between both rasters may yield values that range from 0 to 11 (type a). A more meaningful range that considers the circular nature of the annual cycle would range from 0 to 6 (type b). This function converts a raster of type (a) to type (b).

Usage

1

Arguments

x

A raster object of type (a)

Value

A raster object of type (b)

Examples

1
2
3
4
5
6
7
8
9
library(raster)
# make some data
data <- runif(100,0,11)
data <- matrix(data, ncol=10)
data <- raster::raster(data)
# convert raster of type (a) to type (b)
data <- calc(data,intFun.grid.phase)
plot(data)
plot(data); text(data)

amber documentation built on Aug. 28, 2020, 5:08 p.m.