Accessors | R Documentation |
Accessor methods for slots of objects of class memuse
.
mu.size(x, as.is = TRUE) mu.unit(x) mu.prefix(x) mu.names(x) ## S4 method for signature 'memuse' mu.size(x, as.is = TRUE) ## S4 method for signature 'memuse' mu.unit(x) ## S4 method for signature 'memuse' mu.prefix(x) ## S4 method for signature 'memuse' mu.names(x)
x |
memuse object |
as.is |
logical; should the size be "as-is", or converted to bytes first. |
These methods are mostly just syntactic sugar for ordinary S4 slot
accessing. So for example, size(x)
is no different semantically from
calling x@size
.
There are two differences, however. The size()
method has a
parameter as.is
which controls whether the return should be the raw
value or the raw value converted to bytes first. For the latter, you should
really use as.numeric
instead, which is equivalent to calling
size(x, as.is=FALSE)
.
Returns a numeric value in the case of size()
, and
as.numeric()
, otherwise a string is returned.
memuse-class
## Not run: x <- mu(1e6) size(x) as.numeric(x) mu.unit(x) mu.prefix(x) mu.names(x) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.