Title: | Memory Estimation Utilities |
---|---|
Description: | How much ram do you need to store a 100,000 by 100,000 matrix? How much ram is your current R session using? How much ram do you even have? Learn the scintillating answer to these and many more such questions with the 'memuse' package. |
Authors: | Drew Schmidt [aut, cre], Christian Heckendorf [ctb] (FreeBSD improvements to meminfo), Wei-Chen Chen [ctb] (Windows build fixes), Dan Burgess [ctb] (donation of a Mac for development and testing) |
Maintainer: | Drew Schmidt <[email protected]> |
License: | BSD 2-clause License + file LICENSE |
Version: | 4.2-3 |
Built: | 2024-11-12 04:56:14 UTC |
Source: | https://github.com/shinra-dev/memuse |
Originally an amusing fancy printing system, this package contains that, as well as some functionality for showing. As of version 2.0, the package contains some helpful utilities for accessing hardware ram information, ram usage of the current R process, as well as some other niceties.
If you do a lot of benchmarking, this is the package you've been waiting for. Maybe. I mean, I don't want to be too pushy about it.
Drew Schmidt
Project home page: https://shinra-dev.github.io
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)
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.
## Not run: x <- mu(1e6) size(x) as.numeric(x) mu.unit(x) mu.prefix(x) mu.names(x) ## End(Not run)
## Not run: x <- mu(1e6) size(x) as.numeric(x) mu.unit(x) mu.prefix(x) mu.names(x) ## End(Not run)
Binary arithmetic operations for memuse
objects.
## S4 method for signature 'memuse,memuse' e1 + e2 ## S4 method for signature 'memuse,numeric' e1 + e2 ## S4 method for signature 'numeric,memuse' e1 + e2 ## S4 method for signature 'memuse,object_size' e1 + e2 ## S4 method for signature 'object_size,memuse' e1 + e2 ## S4 method for signature 'memuse,memuse' e1 - e2 ## S4 method for signature 'memuse,numeric' e1 - e2 ## S4 method for signature 'numeric,memuse' e1 - e2 ## S4 method for signature 'memuse,missing' e1 - e2 ## S4 method for signature 'memuse,object_size' e1 - e2 ## S4 method for signature 'object_size,memuse' e1 - e2 ## S4 method for signature 'memuse,memuse' e1 * e2 ## S4 method for signature 'memuse,numeric' e1 * e2 ## S4 method for signature 'numeric,memuse' e1 * e2 ## S4 method for signature 'memuse,object_size' e1 * e2 ## S4 method for signature 'object_size,memuse' e1 * e2 ## S4 method for signature 'memuse,memuse' e1 / e2 ## S4 method for signature 'memuse,numeric' e1 / e2 ## S4 method for signature 'numeric,memuse' e1 / e2 ## S4 method for signature 'memuse,object_size' e1 / e2 ## S4 method for signature 'object_size,memuse' e1 / e2 ## S4 method for signature 'memuse,memuse' e1 ^ e2 ## S4 method for signature 'memuse,numeric' e1 ^ e2
## S4 method for signature 'memuse,memuse' e1 + e2 ## S4 method for signature 'memuse,numeric' e1 + e2 ## S4 method for signature 'numeric,memuse' e1 + e2 ## S4 method for signature 'memuse,object_size' e1 + e2 ## S4 method for signature 'object_size,memuse' e1 + e2 ## S4 method for signature 'memuse,memuse' e1 - e2 ## S4 method for signature 'memuse,numeric' e1 - e2 ## S4 method for signature 'numeric,memuse' e1 - e2 ## S4 method for signature 'memuse,missing' e1 - e2 ## S4 method for signature 'memuse,object_size' e1 - e2 ## S4 method for signature 'object_size,memuse' e1 - e2 ## S4 method for signature 'memuse,memuse' e1 * e2 ## S4 method for signature 'memuse,numeric' e1 * e2 ## S4 method for signature 'numeric,memuse' e1 * e2 ## S4 method for signature 'memuse,object_size' e1 * e2 ## S4 method for signature 'object_size,memuse' e1 * e2 ## S4 method for signature 'memuse,memuse' e1 / e2 ## S4 method for signature 'memuse,numeric' e1 / e2 ## S4 method for signature 'numeric,memuse' e1 / e2 ## S4 method for signature 'memuse,object_size' e1 / e2 ## S4 method for signature 'object_size,memuse' e1 / e2 ## S4 method for signature 'memuse,memuse' e1 ^ e2 ## S4 method for signature 'memuse,numeric' e1 ^ e2
e1 , e2
|
|
Simple binary arithmetic for memuse
objects. Options include any
combination of memuse
, object_size
(output from the
object.size()
function), and numeric
objects.
Returns a memuse
class object.
## Not run: x <- mu(200) y <- mu(100) x+y x-y x*y x/y x^2 ## End(Not run)
## Not run: x <- mu(200) y <- mu(100) x+y x-y x*y x/y x^2 ## End(Not run)
Shows the size of the cache line.
Sys.cachelinesize()
Sys.cachelinesize()
Sys.cachelinesize()
will return the cache linesize. It's almost
certainly 32 or 64 bytes.
Returns a list, whose values are platform dependent.
## Not run: library(memuse) Sys.cachelinesize() ## End(Not run)
## Not run: library(memuse) Sys.cachelinesize() ## End(Not run)
Shows the sizes of the CPU caches.
Sys.cachesize()
Sys.cachesize()
Sys.cachesize()
will check the various levels of cache and return all
available cache information in a list. If you don't have some kind of
level-1 cache, then it will return an error. If you have some kind of
future space computer with more than 3 levels of cache, levels higher than 3
will not be displayed.
Returns a list, whose values are platform dependent.
## Not run: library(memuse) Sys.cachesize() ## End(Not run)
## Not run: library(memuse) Sys.cachesize() ## End(Not run)
Binary comparators for memuse
objects.
## S4 method for signature 'memuse,memuse' e1 == e2 ## S4 method for signature 'memuse,memuse' e1 < e2 ## S4 method for signature 'memuse,memuse' e1 <= e2 ## S4 method for signature 'memuse,memuse' e1 > e2 ## S4 method for signature 'memuse,memuse' e1 >= e2 ## S4 method for signature 'memuse,memuse' e1 != e2 ## S4 method for signature 'memuse,numeric' e1 == e2 ## S4 method for signature 'memuse,numeric' e1 < e2 ## S4 method for signature 'memuse,numeric' e1 <= e2 ## S4 method for signature 'memuse,numeric' e1 > e2 ## S4 method for signature 'memuse,numeric' e1 >= e2 ## S4 method for signature 'memuse,numeric' e1 != e2 ## S4 method for signature 'numeric,memuse' e1 == e2 ## S4 method for signature 'numeric,memuse' e1 < e2 ## S4 method for signature 'numeric,memuse' e1 <= e2 ## S4 method for signature 'numeric,memuse' e1 > e2 ## S4 method for signature 'numeric,memuse' e1 >= e2 ## S4 method for signature 'numeric,memuse' e1 != e2
## S4 method for signature 'memuse,memuse' e1 == e2 ## S4 method for signature 'memuse,memuse' e1 < e2 ## S4 method for signature 'memuse,memuse' e1 <= e2 ## S4 method for signature 'memuse,memuse' e1 > e2 ## S4 method for signature 'memuse,memuse' e1 >= e2 ## S4 method for signature 'memuse,memuse' e1 != e2 ## S4 method for signature 'memuse,numeric' e1 == e2 ## S4 method for signature 'memuse,numeric' e1 < e2 ## S4 method for signature 'memuse,numeric' e1 <= e2 ## S4 method for signature 'memuse,numeric' e1 > e2 ## S4 method for signature 'memuse,numeric' e1 >= e2 ## S4 method for signature 'memuse,numeric' e1 != e2 ## S4 method for signature 'numeric,memuse' e1 == e2 ## S4 method for signature 'numeric,memuse' e1 < e2 ## S4 method for signature 'numeric,memuse' e1 <= e2 ## S4 method for signature 'numeric,memuse' e1 > e2 ## S4 method for signature 'numeric,memuse' e1 >= e2 ## S4 method for signature 'numeric,memuse' e1 != e2
e1 , e2
|
|
Comparisons to numeric values are done at the byte level.
Returns a memuse
class object.
## Not run: x <- mu(2000) y <- mu(3000) x < y x <= y x > y x >= y x == y x != y ## End(Not run)
## Not run: x <- mu(2000) y <- mu(3000) x < y x <= y x > y x >= y x == y x != y ## End(Not run)
Constructor for objects of class memuse
.
mu(size, unit = "best", prefix = "IEC", names = "short") ## S4 method for signature 'ANY' mu(size, unit = "best", prefix = "IEC", names = "short") ## S4 method for signature ''NULL'' mu(size, unit = "best", prefix = "IEC", names = "short") ## S4 method for signature 'numeric' mu(size, unit = "best", prefix = "IEC", names = "short") ## S4 method for signature 'object_size' mu(size, unit = "best", prefix = "IEC", names = "short") ## S4 method for signature 'missing' mu(size, unit = "best", prefix = "IEC", names = "short") memuse(size, unit = "best", prefix = "IEC", names = "short") ## S4 method for signature 'ANY' memuse(size, unit = "best", prefix = "IEC", names = "short") ## S4 method for signature ''NULL'' memuse(size, unit = "best", prefix = "IEC", names = "short") ## S4 method for signature 'missing' memuse(size, unit = "best", prefix = "IEC", names = "short") ## S4 method for signature 'numeric' memuse(size = size, unit = "best", prefix = "IEC", names = "short") ## S4 method for signature 'object_size' memuse(size, unit = "best", prefix = "IEC", names = "short")
mu(size, unit = "best", prefix = "IEC", names = "short") ## S4 method for signature 'ANY' mu(size, unit = "best", prefix = "IEC", names = "short") ## S4 method for signature ''NULL'' mu(size, unit = "best", prefix = "IEC", names = "short") ## S4 method for signature 'numeric' mu(size, unit = "best", prefix = "IEC", names = "short") ## S4 method for signature 'object_size' mu(size, unit = "best", prefix = "IEC", names = "short") ## S4 method for signature 'missing' mu(size, unit = "best", prefix = "IEC", names = "short") memuse(size, unit = "best", prefix = "IEC", names = "short") ## S4 method for signature 'ANY' memuse(size, unit = "best", prefix = "IEC", names = "short") ## S4 method for signature ''NULL'' memuse(size, unit = "best", prefix = "IEC", names = "short") ## S4 method for signature 'missing' memuse(size, unit = "best", prefix = "IEC", names = "short") ## S4 method for signature 'numeric' memuse(size = size, unit = "best", prefix = "IEC", names = "short") ## S4 method for signature 'object_size' memuse(size, unit = "best", prefix = "IEC", names = "short")
size |
|
unit |
|
prefix |
|
names |
|
For numeric objects, if the length is 1, then its value is used as the number of bytes. Otherwise, the object's memory usage in R is taken for the size parameter.
Returns a memuse
class object.
memuse-class Accessors Converters
## Not run: ### The value passed as 'size' is the number of bytes x <- memuse(100, unit="kb") x y <- memuse(100, unit="kb", prefix="SI") y ### Use the memory usage of object 'size' memuse(rnorm(1e4)) ## End(Not run)
## Not run: ### The value passed as 'size' is the number of bytes x <- memuse(100, unit="kb") x y <- memuse(100, unit="kb", prefix="SI") y ### Use the memory usage of object 'size' memuse(rnorm(1e4)) ## End(Not run)
Converter methods between memuse and base R objects.
as.memuse(x, ...) ## S4 method for signature 'numeric' as.memuse(x, unit = "best", prefix = "IEC", names = "short") ## S4 method for signature 'object_size' as.memuse(x, unit = "best", prefix = "IEC", names = "short") ## S4 method for signature 'character' as.memuse(x, unit = "best", prefix = "IEC", names = "short") ## S4 method for signature 'memuse' as.character(x, ...) ## S4 method for signature 'memuse' as.numeric(x, ...)
as.memuse(x, ...) ## S4 method for signature 'numeric' as.memuse(x, unit = "best", prefix = "IEC", names = "short") ## S4 method for signature 'object_size' as.memuse(x, unit = "best", prefix = "IEC", names = "short") ## S4 method for signature 'character' as.memuse(x, unit = "best", prefix = "IEC", names = "short") ## S4 method for signature 'memuse' as.character(x, ...) ## S4 method for signature 'memuse' as.numeric(x, ...)
x |
Numeric value, object_size data, or appropriate string (see details section for more information). |
... |
Additional arguments. |
unit |
|
prefix |
|
names |
|
These methods convert numeric, object_size
, and string (character)
objects to/from memuse
objects.
as.numeric(x)
for a memuse object x
is just sugar for
mu.size(x, as.is=FALSE)
Strings must be of the same form as the printed output of a a memuse object. For example, "100 KiB" is valid, but "100 (KiB)" is not. As always, case of the unit is ignored, and so "100 kib" would be valid as well.
Returns a character, numeric, or memuse
object, depending on the call.
## Not run: as.memuse(10) ## End(Not run)
## Not run: as.memuse(10) ## End(Not run)
Returns size of a file as reported by the file system (the file is not scanned).
Sys.filesize(filename) Sys.dirsize(dirname)
Sys.filesize(filename) Sys.dirsize(dirname)
filename , dirname
|
Location of the file/directory (as a string). |
All of the C-level source code for these methods (in src/meminfo of the root directory of the memuse source tree) is licensed under the permissive 2-Clause BSD license.
A memuse class object.
## Not run: library(memuse) x <- rnorm(1e5) memuse(x) ### size in ram tmp <- tempfile() saveRDS(x, file=tmp) Sys.filesize(tmp) ### size on disk unlink(tmp) ## End(Not run)
## Not run: library(memuse) x <- rnorm(1e5) memuse(x) ### size in ram tmp <- tempfile() saveRDS(x, file=tmp) Sys.filesize(tmp) ### size on disk unlink(tmp) ## End(Not run)
Determines the memory usage for a dense, in-core, numeric matrix of specified rows/columns.
howbig( nrow = 1, ncol = 1, representation = "dense", unit = "best", prefix = "IEC", names = "short", sparsity = 0.05, type = "double", intsize = 4 )
howbig( nrow = 1, ncol = 1, representation = "dense", unit = "best", prefix = "IEC", names = "short", sparsity = 0.05, type = "double", intsize = 4 )
nrow , ncol
|
Number of (global) rows/columns of the matrix. |
representation |
The kind of storage the object would be in, i.e. "dense" or "sparse". |
unit |
string; the unit of storage, such as "MiB" or "MB", depending on prefix. Case is ignored. |
prefix |
string; the unit prefix, namely IEC or SI. Case is ignored. |
names |
string; control for whether the unit names should be printed out or their abbreviation should be used. Options are "long" and "short", respectively. Case is ignored. |
sparsity |
The proportion of sparsity of the matrix if
|
type |
"float", "double", or "int"; the storage type of the data matrix. If you don't know the type, it is probably stored as a double, so the default value will suffice. |
intsize |
The size (in bytes) of an integer. Default is 4, but this is platform dependent. |
These functions provide the memory usage of an unallocated, dense, in-core,
numeric matrix. As the name suggests, howbig()
simply returns the
size (as a memuse
object).
returns a memuse
class object.
## Not run: # size of a 1000x1000 matrix howbig(1000, 1000) ## End(Not run)
## Not run: # size of a 1000x1000 matrix howbig(1000, 1000) ## End(Not run)
How many rows/columns of a matrix can be stored for a given memory size.
howmany( x, nrow, ncol, out.type = "full", representation = "dense", ..., sparsity = 0.05, type = "double", intsize = 4, names = "short" )
howmany( x, nrow, ncol, out.type = "full", representation = "dense", ..., sparsity = 0.05, type = "double", intsize = 4, names = "short" )
x |
The size of a matrix stored as a |
nrow , ncol
|
Number of (global) rows/columns of the matrix. |
out.type |
If the full dimensions or a reduced representation should be returned (see Details section below). Options are "full" and "approximate" (with partial matching). |
representation |
The kind of storage the object would be in, i.e. "dense" or "sparse". |
... |
Additional arguments. |
sparsity |
The proportion of sparsity of the matrix if
|
type |
"double" or "int"; the storage type of the data matrix. If you don't know the type, it is probably stored as a double, so the default value will suffice. |
intsize |
The size (in bytes) of an integer. Default is 4, but this is platform dependent. |
names |
string; control for whether the unit names should be printed out or their abbreviation should be used. Options are "long" and "short", respectively. Case is ignored. |
This function provides the maximum dimension of an unallocated, dense, in-core, numeric matrix of known byte size. For example, it will show the largest possible square matrix which is 16 GiB (46340x46340).
If the both nrow
and ncol
are missing (blank inputs), then the
largest square matrix will be returned. If one of nrow
or
ncol
is supplied and the other is missing, then the non-supplied
argument (nrow
or ncol
) will be determined according to the
supplied one. If both arguments are supplied, an error is produced — you
probably meant to use howmany()
.
If out.type="approximate"
, then a reduced representation of the
dimensions will be returned. For example, the reduced representation of the
number 1234567890 would be "1.2b", since this number is basically 1.2
billion. Not super useful, but kind of cute, and it arguably enhances
readability when fishing for a ballpark figure.
A numeric pair, the dimensions of a matrix.
## Not run: x <- mu(1, "gib") # largest square matrix that's 1 GiB howmany(x) # same, but ballpark figure howmany(mu(1, "gib"), out.type="approx") ## End(Not run)
## Not run: x <- mu(1, "gib") # largest square matrix that's 1 GiB howmany(x) # same, but ballpark figure howmany(mu(1, "gib"), out.type="approx") ## End(Not run)
A rich man's exponential notation.
hr(x, names = "comma", digits = 2)
hr(x, names = "comma", digits = 2)
x |
A number. |
names |
"long", "short", or "comma"; determines wheter the output reads like "10 million", "10m", or "10,000,000", respectively. |
digits |
The number of decimal digits to retain. |
Approximate size of an integer. Very useful when dealing with potentially
large values, such as those from howmany()
.
An object of class humanreadable
.
## Not run: library(memuse) hr(12345678) hr(12345678, "long") ## End(Not run)
## Not run: library(memuse) hr(12345678) hr(12345678, "long") ## End(Not run)
Platform memory information.
Sys.meminfo(compact.free = TRUE)
Sys.meminfo(compact.free = TRUE)
compact.free |
logical; determines whether various free memory values should be combined into a single value. See details section for more information. |
Sys.meminfo()
returns some basic memory values, such as total ram,
free ram, and ram used for buffers/cache (when applicable).
All of the C-level source code for these methods (in src/meminfo of the root directory of the memuse source tree) is licensed under the permissive 2-Clause BSD license.
Returns a list, whose values are platform dependent in addition to being modified by input arguments.
## Not run: library(memuse) Sys.meminfo() ## End(Not run)
## Not run: library(memuse) Sys.meminfo() ## End(Not run)
Memory usage class object.
size
The actual size in some memuse units.
unit
The mem unit (e.g., byte, kilobyte, etc.)
unit.prefix
IEC or SI units
unit.names
short (e.g., kb) or long (e.g., kilobyte)
humanreadable
objectsPrinting for hr()
## S3 method for class 'humanreadable' print(x, ...)
## S3 method for class 'humanreadable' print(x, ...)
x |
|
... |
unused |
Print and show methods for memuse
class objects.
## S4 method for signature 'memuse' print( x, ..., unit = mu.unit(x), prefix = mu.prefix(x), names = mu.names(x), digits = 3 ) ## S4 method for signature 'memuse' show(object)
## S4 method for signature 'memuse' print( x, ..., unit = mu.unit(x), prefix = mu.prefix(x), names = mu.names(x), digits = 3 ) ## S4 method for signature 'memuse' show(object)
x , object
|
|
... |
extra arguments |
unit |
the unit to be used in printing; defaults to |
prefix |
the unit prefix to be used in printing; defaults to
|
names |
the unit names (short or long) to be used in printing;
defaults to |
digits |
the number of decimal digits to print; default is 3 |
\ link{Constructor} memuse-class
## Not run: x <- mu(1e6) print(x) x # same as show(x) ## End(Not run)
## Not run: x <- mu(1e6) print(x) x # same as show(x) ## End(Not run)
sysinfo
objectsPrinting for sysinfo
objects.
## S3 method for class 'sysinfo' print(x, ...)
## S3 method for class 'sysinfo' print(x, ...)
x |
|
... |
unused |
Shows the amount of ram used by the current R process.
Sys.procmem(gcFirst = TRUE)
Sys.procmem(gcFirst = TRUE)
gcFirst |
logical; determines if garbage collection should be called before getting process memory usage. |
Sys.procmem()
returns the total memory usage of the current R
process, and (if supported), the maximum memory usage as well.
All of the C-level source code for these methods (in src/meminfo of the root directory of the memuse source tree) is licensed under the permissive 2-Clause BSD license.
Returns a list, whose values are platform dependent in addition to being modified by input arguments.
## Not run: library(memuse) ### How much is being used? Sys.procmem() ### Use more. x <- rnorm(1e7) Sys.procmem() ### Use less. rm(x) gc(FALSE) Sys.procmem() ## End(Not run)
## Not run: library(memuse) ### How much is being used? Sys.procmem() ### Use more. x <- rnorm(1e7) Sys.procmem() ### Use less. rm(x) gc(FALSE) Sys.procmem() ## End(Not run)
Binary arithmetic operations for memuse
objects.
## S4 method for signature 'memuse' sum(x, ..., na.rm = FALSE)
## S4 method for signature 'memuse' sum(x, ..., na.rm = FALSE)
x |
A |
... |
Additional arguments |
na.rm |
Whether |
Simple arithmetic reductions.
Returns a memuse
class object.
## Not run: x = mu(2000) y = mu(5000) sum(x, y) ### Mixing numeric and memuse objects will work, but the first one must be a ### memuse object. sum(mu(10), 10) # This will work sum(10, mu(10)) # This will not ## End(Not run)
## Not run: x = mu(2000) y = mu(5000) sum(x, y) ### Mixing numeric and memuse objects will work, but the first one must be a ### memuse object. sum(mu(10), 10) # This will work sum(10, mu(10)) # This will not ## End(Not run)
Platform swap information.
Sys.swapinfo() Sys.pageinfo()
Sys.swapinfo() Sys.pageinfo()
Sys.swapinfo()
returns basic swap/page (virtual memory) information.
Sys.pageinfo()
is identical to swapinfo()
in every way but
name (provided for Windows users who may be more comfortable/familiar with
the 'pagefile' naming convention).
All of the C-level source code for these methods (in src/meminfo of the root directory of the memuse source tree) is licensed under the permissive 2-Clause BSD license.
Returns a list, whose values are platform dependent in addition to being modified by input arguments.
## Not run: library(memuse) Sys.swapinfo() ## End(Not run)
## Not run: library(memuse) Sys.swapinfo() ## End(Not run)
Methods for swapping between different memuse formats.
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)
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)
x |
memuse object |
unit |
new unit for the |
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.
Returns a memuse
class object.
## Not run: x <- mu(1e6) x swap.prefix(x) swap.names(x) swap.unit(x, "bytes") ## End(Not run)
## Not run: x <- mu(1e6) x swap.prefix(x) swap.names(x) swap.unit(x, "bytes") ## End(Not run)