subset-.bk: Single-bracket assign

[<-.bkR Documentation

Single-bracket assign

Description

Behavior depends on the class of i. For character vectors, this assigns to the named list entries of x (as usual). For numeric indices, it assigns vectorized grid data values. For multi-layer objects, specify the layer in j and supply a matrix for replacement

Usage

## S3 replacement method for class 'bk'
x[i = NULL, j = NULL, ...] <- value

Arguments

x

a bk object

i

column-vectorized index

j

index of layer (only for multi-layer x)

value

the replacement values

...

ignored

Value

the "bk" object with the specified subset replaced by value

Examples

g = bk_validate(list(gval=rnorm(4^2), gdim=4, gres=0.5))
print(g)
g[1] = NA
print(g)


deankoch/pkern documentation built on Oct. 26, 2023, 8:54 p.m.