subsetVALUE | R Documentation |
Creates a new predictions/observations VALUE object that is a subset of the input object along the selected dimensions
subsetVALUE(
valueObj,
stationID = NULL,
members = NULL,
season = NULL,
dates = NULL,
years = NULL,
lonLim = NULL,
latLim = NULL
)
valueObj |
The input object to be subset. This is either an observation, as returned by |
stationID |
Character string. Station codes. |
members |
An integer vector indicating the position of the members to be subset. Default to NULL. |
season |
An integer vector indicating the months to be subset. |
dates |
A vector of dates for subsetting on arbitrary dates. This is a character (or |
years |
The years to be selected. Note that this can be either a continuous or discontinuous
series of years, the latter option often used in a cross-validation framework.
See details for year-crossing seasons. Default to |
lonLim |
Vector of length = 2, with minimum and maximum longitude coordinates, in decimal degrees,
of the bounding box defining the subset. For single-station subsets, a numeric value with the
longitude coordinate. If |
latLim |
Same as |
The attribute subset
will be added to the different slots corresponding to the subset dimensions, taking
the value of the subroutine called in each case (e.g.: attribute subset will have the value subsetSpatial
in the xyCoords slot after spatial subsetting...).
Time slicing by years
In case of year-crossing seasons (e.g. boreal winter (DJF), season = c(12,1,2)
),
the season is assigned to the years of January and February
(i.e., winter of year 2000 corresponds to Dec 1999, Jan 2000 and Feb 2000). Thus,
the years
argument must be introduced accordingly.
Spatial slicing
Spatial subset definition is done via the lonLim
and latLim
arguments, in the same way as
in the loadValueStations
function. It is also possible to
make single-station selections from a multi-station object, just by specifying a single coordinate instead of a range
as the argument value. For instance lonLim=c(-10,10)
and latLim=c(35,45)
indicates a
rectangular window centered in the Iberian Peninsula), and single grid-cell values
(for instance lonLim=-3.21
and latLim=41.087
for retrieving the data in the closest grid
point to the point coordinate -3.21E, 41.087N. In both cases, the function
operates by finding the nearest (euclidean distance) stations to the coordinates introduced
(either north/south or east/westward).
A new VALUE stations/predictions object that is a logical subset of the input object along the specified dimensions.
J. Bedia
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.