Learn R Programming

smint (version 0.4.2)

subset_Grid: Subgrid by selection of levels in one dimension.

Description

Subgrid by selection of levels in one dimension.

Usage

subset_Grid(X, subset, type = c("index", "Grid", "both"), drop = TRUE)

Arguments

X
An object with class "Grid".
subset
An expression concerning one of the dimension of X. This can be compared to an expression in the subset method.
type
The wanted type of result. When type is "index", the returned result is an integer vector containing the indices of the subgrid nodes in the original grid. When type is "Grid" the result is the subgrid as an object of this class. Finally when type is "both" a list is returned containing the two previous types of result under the names index and Grid.
drop
Logical. If TRUE and if only one level is selected with subset then the corresponding dimension of the (flat) Grid result will be dropped.

Value

A vector of integer indices, a Grid object or a list embedding these two elements, depending on the value of type.

See Also

The subset method.

Examples

Run this code
myGD <- Grid(levels = list("Temp" = c(250, 260, 280, 290, 300),
                           "Press" = c(3, 4, 6, 10)))
myGD2 <- subset_Grid(myGD, subset = Temp > 280)

Run the code above in your browser using DataLab