Subset an immutable object, returning another immutable object.
Usage
subset.immutable(x, ...)
# S3 method for immutable
[(x, ...)
# S3 method for immutable
[[(x, ...)
# S3 method for immutable
$(x, ...)
Arguments
- x
An R object inheriting from the "immutable" S3-class.
- ...
Catch any additional parameters. Lets objects with arbitrary
dimensions be made immutable.
Value
An immutable subset of x
.
Examples
immut_mat <- immutable(matrix(1:100, 10, 10))
immut_mat[1:5, 1:5]
#> immutable matrix array
#> [,1] [,2] [,3] [,4] [,5]
#> [1,] 1 11 21 31 41
#> [2,] 2 12 22 32 42
#> [3,] 3 13 23 33 43
#> [4,] 4 14 24 34 44
#> [5,] 5 15 25 35 45