Learn R Programming

memuse (version 2.5)

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
"size"(x) <- value
"unit"(x) <- value
"unit.prefix"(x) <- value
"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
# ## End(Not run)

Run the code above in your browser using DataLab