getRefDates: Retrieve reference dates

View source: R/helpers.R

getRefDatesR Documentation

Retrieve reference dates

Description

Retrieves the $start component of the $Dates element of a grid or station. In case of multigrids, the dates from the first grid are returned (i.e.: grid$Dates[[1]]$start).

Usage

getRefDates(obj, which = "start")

Arguments

obj

A grid or station object

which

Character string. The element of the $Dates list to be extracted. Default to "start", otherwise "end".

Details

This utility function should be used always that reference dates are internally required by any function. It takes into account the particular case when redim is applied to create a singleton "var" dimension: in this situation, the "Dates" component is not changed accordingly, and thus the criterion to distinguish multigrids from redim-ed grids is the shape of the array.

Value

A character vector of dates

Author(s)

J. Bedia

See Also

Other get.helpers: get2DmatCoordinates(), getCoordinates(), getDim(), getGrid(), getGridProj(), getGridVerticalLevels(), getSeason(), getShape(), getStationID(), getVarNames(), getWT(), getYearsAsINDEX(), setGridProj(), typeofGrid(), which.leap()

Examples

 
require(climate4R.datasets)
#Station data:
data("VALUE_Iberia_tas")
str(getRefDates(VALUE_Iberia_tas))
#Regular grid
data("NCEP_Iberia_hus850")
str(getRefDates(NCEP_Iberia_hus850, which = "end"))


SantanderMetGroup/transformeR documentation built on Nov. 25, 2024, 1:25 p.m.