ls.str {utils}
Description
ls.str and lsf.str are variations of ls applying str() to each matched name: see section Value.
Usage
ls.str(pos = -1, name, envir, all.names = FALSE,
pattern, mode = "any")
lsf.str(pos = -1, envir, ...)
## S3 method for class 'ls_str':
print((x, max.level = 1, give.attr = FALSE, ...,
digits = max(1, getOption("str")$digits.d)))
Arguments
- pos
- integer indicating
searchpath position, or-1for the current environment. - name
- optional name indicating
searchpath position, seels. - envir
- environment to use, see
ls. - all.names
- logical indicating if names which begin with a
.are omitted; seels. - pattern
- a regular expression passed to
ls. Only names matchingpatternare considered. - max.level
- maximal level of nesting which is applied for displaying nested structures, e.g., a list containing sub lists. Default 1: Display only the first nested level.
- give.attr
- logical; if
TRUE(default), show attributes as sub structures. - mode
- character specifying the
modeof objects to consider. Passed toexistsandget. - x
- an object of class
"ls_str". - ...
- further arguments to pass.
lsf.strpasses them tols.strwhich passes them on tols. The (non-exported) print methodprint.ls_strpasses them tostr. - digits
- the number of significant digits to use for printing.
Values
ls.str and lsf.str return an object of class "ls_str", basically the character vector of matching names (functions only for lsf.str), similarly to ls, with a print() method that calls str() on each object.
Examples
require(stats) lsf.str() #- how do the functions look like which I am using? ls.str(mode = "list") #- what are the structured objects I have defined? ## create a few objects example(glm, echo = FALSE) ll <- as.list(LETTERS) print(ls.str(), max.level = 0)# don't show details ## which base functions have "file" in their name ? lsf.str(pos = length(search()), pattern = "file") ## demonstrating that ls.str() works inside functions ## ["browser/debug mode"]: tt <- function(x, y = 1) { aa <- 7; r <- x + y; ls.str() } (nms <- sapply(strsplit(capture.output(tt(2))," *: *"), `[`, 1)) stopifnot(nms == c("aa", "r","x","y"))
Documentation reproduced from R 2.15.3. License: GPL-2.
