subsetDimension: Arbitrary grid subsetting along one of its dimensions

View source: R/subsetGrid.R

subsetDimensionR Documentation

Arbitrary grid subsetting along one of its dimensions

Description

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

Usage

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(), intersectGrid.spatial(), intersectGrid.time(), limitArea(), subsetCluster(), subsetGrid(), subsetMembers(), subsetRuntime(), subsetSeason(), subsetSpatial(), subsetStation(), subsetVar(), subsetYears()

Examples


require(climate4R.datasets)
# Example - Member subset
data("CFS_Iberia_tas")
# Selection of members 3 and 7
sub <- subsetDimension(CFS_Iberia_tas,
                       dimension = "member",
                       indices = 1:2)
require(visualizeR)
spatialPlot(climatology(sub), backdrop.theme = "coastline")


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