DelayedSubassign-class {DelayedArray} | R Documentation

## DelayedSubassign objects

### Description

NOTE: This man page is about DelayedArray internals and is provided for developers and advanced users only.

The DelayedSubassign class provides a formal representation of a delayed multi-dimensional single bracket subassignment. It is a concrete subclass of the DelayedUnaryIsoOp virtual class, which itself is a subclass of the DelayedUnaryOp virtual class, which itself is a subclass of the DelayedOp virtual class:

                              DelayedOp
                                  ^
                                  |
                           DelayedUnaryOp
                                  ^
                                  |
                          DelayedUnaryIsoOp
                                  ^
                                  |
                          DelayedSubassign

DelayedSubassign objects are used inside a DelayedArray object to represent the delayed multi-dimensional single bracket subassignments carried by the object. They're never exposed to the end user and are not intended to be manipulated directly.

### Usage

    ## S4 method for signature 'DelayedSubassign'
    is_noop(x)

    ## S4 method for signature 'DelayedSubassign'
    summary(object, ...)

    ## ~ ~ ~ Seed contract ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

    ## DelayedSubassign objects inherit the default dim()
    ## and dimnames() methods defined for DelayedUnaryIsoOp
    ## derivatives, but overwite their extract_array() method.

    ## S4 method for signature 'DelayedSubassign'
    extract_array(x, index)

    ## ~ ~ ~ Propagation of sparsity ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

    ## S4 method for signature 'DelayedSubassign'
    is_sparse(x)

    ## S4 method for signature 'DelayedSubassign'
    extract_sparse_array(x, index)

### Arguments

`x, object` | A DelayedSubassign object.
`index` | See `?extract_array` for a description of the `index` argument.
`...` | Not used.

### See Also

- DelayedOp objects.

- `showtree` to visualize the nodes and access the leaves in the tree of delayed operations carried by a DelayedArray object.

- `extract_array` and `extract_sparse_array`.

### Examples

    ## DelayedSubassign extends DelayedUnaryIsoOp, which extends
    ## DelayedUnaryOp, which extends DelayedOp:
    extends("DelayedSubassign")

    ## ---------------------------------------------------------------------
    ## BASIC EXAMPLE
    ## ---------------------------------------------------------------------
    m0 <- matrix(1:30, ncol=5)
    M2 <- M1 <- M0 <- DelayedArray(m0)
    showtree(M0)

    M1[2:5, 5:4] <- 100
    showtree(M1)
    class(M1@seed)        # a DelayedSubassign object

    M2[2:5, 5:4] <- matrix(101:108, ncol=2)
    showtree(M2)
    class(M2@seed)        # a DelayedSubassign object

    ## ---------------------------------------------------------------------
    ## PROPAGATION OF SPARSITY
    ## ---------------------------------------------------------------------

    ## DelayedSubassign objects don't propagate sparsity at the moment, that
    ## is, is_sparse() always returns FALSE on them.

    ## ---------------------------------------------------------------------
    ## SANITY CHECKS
    ## ---------------------------------------------------------------------
    stopifnot(class(M1@seed) == "DelayedSubassign")
    stopifnot(class(M2@seed) == "DelayedSubassign")

[Package DelayedArray version 0.18.0 Index]