lss: List object names along with classes and sizes

lssR Documentation

List object names along with classes and sizes

Description

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

Usage

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


# 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 Oct. 16, 2023, 8:18 p.m.