R: Swaps

Swaps {memuse} | R Documentation

## Swaps

### Description

Methods for swapping between different memuse formats.

### Usage

    swap.prefix(x)

    ## S4 method for signature 'memuse'
    swap.prefix(x)

    swap.names(x)

    ## S4 method for signature 'memuse'
    swap.names(x)

    swap.unit(x, unit)

    ## S4 method for signature 'memuse'
    swap.unit(x, unit)

### Arguments

`x` | memuse object
`unit` | new unit for the `memuse` object after the swap occurs

### Details

These methods allow simple (coherent) swaps between the different `memuse` formats.

`swap.unit()` will switch an object to another, supplied unit. If the unit is from another prefix, then the prefix too will change. In this case, the size will change appropriately.

`swap.prefix()` will change an object from one unit.prefix to the other. In this case, the size will change appropriately.

`swap.names` will change from short to long, or long to short printing. The size and prefix of the object are unchanged.

### Value

Returns a `memuse` class object.

### See Also

`Constructor memuse-class`

### Examples

    ## Not run:
    x <- mu(1e6)

    x
    swap.prefix(x)
    swap.names(x)
    swap.unit(x, "bytes")

    ## End(Not run)

[Package memuse version 4.1-0 Index]