R: Replacers

Replacers {memuse} | R Documentation

## Replacers

### Description

Replacement methods for slots of objects of class `memuse`.

### Usage

    size(x) <- value

    unit(x) <- value

    unit.prefix(x) <- value

    unit.names(x) <- value

    ## S4 replacement method for signature 'memuse'
    size(x) <- value

    ## S4 replacement method for signature 'memuse'
    unit(x) <- value

    ## S4 replacement method for signature 'memuse'
    unit.prefix(x) <- value

    ## S4 replacement method for signature 'memuse'
    unit.names(x) <- value

### Arguments

`x` | memuse object
`value` | replacement value

### Details

These methods are syntactic sugar for assignment using ordinary S4 accessors. So for example, `size(x) <- 10` is semantically no different from calling `x@size <- 10`

These methods are strict replacement methods; if you need to swap the units of a `memuse` class object, you should probably be using the `Swaps` methods. See example below for further details.

### Value

Returns a numeric element in the case of `size()`, otherwise a string is returned.

### See Also

`Accessors memuse-class`

### Examples

    ## Not run:
    x <- mu(2000, unit="bytes")
    x

    size(x) <- 1000
    x

    ## End(Not run)

[Package memuse version 3.0-1 Index]