gmGeostats (version 0.10-6)

[.gmCgram: Subsetting of gmCgram variogram structures

Description

Extraction of some variables of a gmCgram object

Usage

# S3 method for gmCgram
[(x, i, j = i, ...)

Arguments

x

gmCgram variogram object

i

row-indices of the variables to be kept/removed

j

column-indices of the variables to be kept/removed (if only i is specified, j will be taken as equal to i!)

...

extra arguments for generic functionality

Value

a gmCgram variogram object with the desired variables only.

Details

This function can be used to extract the model for a a subset of variables. If only i is specified, j will be taken as equal to i. If you want to select all i's for certain j's or vice versa, give i=1:dim(x$nugget)[1] and j= your desired indices, respectively j=1:dim(x$nugget)[2] and i= your desired indices; replace x by the object you are giving. If i!=j, the output will be a c("gmXCgram","gmCgram") object, otherwise it will be a regular class "gmCgram" object. If you want to extract "slots" or "elements" of the variogram, use the $-notation. If you want to extract variables of the variogram matrices, use the [-notation.

See Also

Other gmCgram functions: [[.gmCgram(), as.function.gmCgram(), as.gmCgram.variogramModelList(), length.gmCgram(), ndirections(), plot.gmCgram(), variogramModelPlot()

Examples

Run this code
# NOT RUN {
utils::data("variogramModels")
v1 = setCgram(type=vg.Gau, sill=diag(2), anisRanges = 3*diag(c(3,1)))
v2 = setCgram(type=vg.Exp, sill=0.3*diag(2), anisRanges = 0.5*diag(2))
vm = v1+v2
vm[1,1]
# }

Run the code above in your browser using DataLab