lsize {mvbutils} | R Documentation |
Report objects and their memory sizes
Description
lsize
is like ls
, except it returns a numeric vector whose names are the object names, and whose elements are the object sizes. The vector is sorted in order of increasing size. lsize
avoids loading objects cached using mlazy
; instead of their true size, it uses the size of the file that stores each cached object, which is shown as a negative number. The file size is typically smaller than the size of the loaded object, because mlazy
saves a compressed version. NB that lsize
will scan all objects in the environment, including ones with funny names, whereas ls
does so only if its all.names
argument is set to TRUE.
Usage
lsize( envir=.GlobalEnv)
Arguments
envir |
where to look for the objects. Will be coerced to environment, so that e.g. |
Value
Named numeric vector.
Author(s)
Mark Bravington
See Also
ls
, mlazy
Examples
# Current workspace
lsize()
# Contrived example to show objects in a function's environment
{function(..., a, b, c) lsize( sys.frame( sys.nframe())) }()
# a, b, c are all missing; this example might break in future R versions
# ... a b c
# 28 28 28 28