lldf function

Long listing of R session objects

Long listing of R session objects

lldf( n = Inf, envir = -1L, items = NULL, use_utils_objectsize = TRUE, all.names = TRUE, ... )

Arguments

  • n: integer or Inf indicating how many objects to include in the output data.frame.

  • envir: environment where the list of objects is obtained, default -1L searches the environment of the caller, usually the user workspace. Other recognized options:

    • character string suitable for as.environment() which recognizes the search path returned by search()
    • integer or numeric equivalent to environment relative position as used in ls() argument pos.
  • items: character of items to include, default NULL.

  • use_utils_objectsize: logical, default TRUE, whether to prefer utils::object.size(), otherwise it will attempt to use pryr::object_size() if the package is installed.

  • all.names: logical passed to base::ls() indicating whether to include all names, where all.names=TRUE will include hidden objects whose name begin with "." such as ".First".

  • ...: additional arguments are passed to ls(), notably pattern can be passed to subset objects by regular expression.

Returns

data.frame with summary of objects and object sizes, sorted by decreasing object size.

Details

This function expands base::ls() by also determining the object size, and sorting to display the top n objects by size, largest first.

This package will call pryr::object_size if available, otherwise falls back to utils::object.size().

Examples

lldf(10); # custom environment newenv <- new.env(); newenv$A <- 1:10; newenv$df <- data.frame(A=1:10, B=11:20); lldf(envir=newenv); rm(newenv);

See Also

Other jam practical functions: breakDensity(), call_fn_ellipsis(), checkLightMode(), check_pkg_installed(), colNum2excelName(), color_dither(), exp2signed(), getAxisLabel(), isFALSEV(), isTRUEV(), jargs(), kable_coloring(), log2signed(), middle(), minorLogTicks(), newestFile(), printDebug(), reload_rmarkdown_cache(), renameColumn(), rmInfinite(), rmNA(), rmNAs(), rmNULL(), setPrompt()

  • Maintainer: James M. Ward
  • License: MIT + file LICENSE
  • Last published: 2025-03-23