getRefDates | R Documentation |
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
).
getRefDates(obj, which = "start")
obj |
A grid or station object |
which |
Character string. The element of the |
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.
A character vector of dates
J. Bedia
Other get.helpers:
get2DmatCoordinates()
,
getCoordinates()
,
getDim()
,
getGrid()
,
getGridProj()
,
getGridVerticalLevels()
,
getSeason()
,
getShape()
,
getStationID()
,
getVarNames()
,
getWT()
,
getYearsAsINDEX()
,
setGridProj()
,
typeofGrid()
,
which.leap()
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"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.