getYearsAsINDEX.VALUE: Get years as a factor

View source: R/util.R

getYearsAsINDEX.VALUER Documentation

Get years as a factor

Description

Extract the year as a factor (e.g. for computing annual statistics)

Usage

getYearsAsINDEX.VALUE(objDates)

Arguments

obj

Any object extending the station or field classes

Details

The function performs a very basic operation, extracting the year element from the dates. The trick lies in the year-crossing seasons. For instance: by convention, winter 2001 encompasses December 2000 and January, February 2001. Therefore, in order to compute annual statistics for a year-crossing season, it is necessary to modify first the vector of years, and assign year 2001 to the preceding December. Similarly, the next December 2001 belongs to winter 2002, and so on... The function is useful for computing and/or plotting annual statistics, seasonal climatologies ...

Value

A vector of years of the same length as the time dimension of the object, seasonally-adjusted in the case of year-crossing seasons (e.g. DJF). See details.

Warning

The function should no be used to extract the actual years vector

Author(s)

juaco


SantanderMetGroup/R_VALUE documentation built on July 4, 2023, 4:27 a.m.