subsetDimension: Arbitrary grid subsetting along one of its dimensions

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/subsetGrid.R

Description

Create a new grid/multigrid that is a subset of the input grid along the selected dimension.

Usage

1
subsetDimension(grid, dimension = NULL, indices = NULL)

Arguments

grid

The input grid to be subset. This is either a grid, as returned e.g. by loadGridData from package loadeR or a multigrid, as returned by makeMultiGrid, or other types of multimember grids (possibly multimember multigrids) as returned e.g. by loadECOMS, from package loadeR.ECOMS.

dimension

Character vector indicating the dimension along which the positions indicated by the indices paraneter. Unlike subsetGrid, only one dimension at a time is accepted here

indices

An integer vector indicating the positions of the dimension to be extracted. In case of subsetting several dimensions at at time, this corresponds to a list of indices.

Details

The attribute subset will be added taking the value of the dimension parameter.

Value

A new grid object that is a logical subset of the input grid along the specified dimension.

Author(s)

J. Bedia and S. Herrera

See Also

Other subsetting: getTemporalIntersection, intersectGrid.spatial, intersectGrid.time, intersectGrid, limitArea, subsetGrid, subsetMembers, subsetRuntime, subsetSeason, subsetSpatial, subsetStation, subsetVar, subsetYears

Examples

1
2
3
4
5
6
7
# Example - Member subset
data("CFS_Iberia_tas")
# Selection of members 3 and 7
sub <- subsetDimension(CFS_Iberia_tas,
                   dimension = "member",
                   indices = 1:2)
plotClimatology(climatology(sub), backdrop.theme = "coastline")

SantanderMetGroup/transformeR documentation built on Nov. 23, 2019, 12:28 p.m.