lss: List object names along with classes and sizes

Description Usage Arguments Details Value See Also Examples

View source: R/lss.R

Description

List, and optionally plot, all the objects in the specified environment along with their class attribute and size in bytes.

Usage

1
lss(graph = FALSE, env = .GlobalEnv, ...)

Arguments

graph

logical, should a dotchart of sizes by produced

env

environment to scan for objects, defaults to Global Environment

...

other arguments passed to ls

Details

The function scans the environment supplied by env with the ls function for objects. Then the classes of these objects are retrieved with object.size.

If graph is TRUE then additionally a dotchart with showing object sizes is produced.

Value

A data frame with two columns “class” and “size” containing the class and size (in bytes) of the objects found in the environment env.

See Also

ls for listing the objects, object.size for calculating the memory size of an object, dotchart for making dotcharts

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# make some environment
e <- new.env()
# create some objects in it
assign("x", rnorm(10), envir=e)
assign("d", data.frame(a=1:10, b=10:1), envir=e)
assign("l", letters, envir=e)

# table of contents
lss(env=e)

# with a chart
lss(TRUE, env=e)

# clean-up
rm(e)

mbojan/mbtools documentation built on Nov. 9, 2017, 3:21 p.m.