Find block duration in years.

blockDuration(date)

Arguments

date

A vector with class "Date" or that can be coerced to this class.

Value

A duration in years.

Details

This is simply a wrapper for the diff method.

Note

For most applications of Time Varying GEV models with TVGEV, the block duration will be one year. Yet it can be sometimes needed to form blocks with longer duration (e.g. two years, five years).

Examples


date <- as.Date(sprintf("%4d-01-01", TXMax_Dijon$Year))
n <- length(date)
blockDuration(date)
#> [1] 1
blockDuration(date[seq(from = 1, to = n, by = 2)])
#> [1] 2