Learn R Programming

memuse (version 3.0-1)

Replacers: 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 method for memuse size(x) <- value

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

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

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

Arguments

x

memuse object

value

replacement value

Value

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

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.

See Also

Accessors memuse-class

Examples

Run this code
# NOT RUN {
x <- mu(2000, unit="bytes")
x

size(x) <- 1000
x
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab