EVOLUTION-MANAGER
Edit File: ls_str.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: List Objects and their Structure</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for ls.str {utils}"><tr><td>ls.str {utils}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>List Objects and their Structure</h2> <h3>Description</h3> <p><code>ls.str</code> and <code>lsf.str</code> are variations of <code><a href="../../base/html/ls.html">ls</a></code> applying <code><a href="str.html">str</a>()</code> to each matched name: see section Value. </p> <h3>Usage</h3> <pre> 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)) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>pos</code></td> <td> <p>integer indicating <code><a href="../../base/html/search.html">search</a></code> path position, or <code>-1</code> for the current environment.</p> </td></tr> <tr valign="top"><td><code>name</code></td> <td> <p>optional name indicating <code><a href="../../base/html/search.html">search</a></code> path position, see <code><a href="../../base/html/ls.html">ls</a></code>.</p> </td></tr> <tr valign="top"><td><code>envir</code></td> <td> <p>environment to use, see <code><a href="../../base/html/ls.html">ls</a></code>.</p> </td></tr> <tr valign="top"><td><code>all.names</code></td> <td> <p>logical indicating if names which begin with a <code>.</code> are omitted; see <code><a href="../../base/html/ls.html">ls</a></code>.</p> </td></tr> <tr valign="top"><td><code>pattern</code></td> <td> <p>a <a href="../../base/html/regex.html">regular expression</a> passed to <code><a href="../../base/html/ls.html">ls</a></code>. Only names matching <code>pattern</code> are considered.</p> </td></tr> <tr valign="top"><td><code>max.level</code></td> <td> <p>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.</p> </td></tr> <tr valign="top"><td><code>give.attr</code></td> <td> <p>logical; if <code>TRUE</code> (default), show attributes as sub structures.</p> </td></tr> <tr valign="top"><td><code>mode</code></td> <td> <p>character specifying the <code><a href="../../base/html/mode.html">mode</a></code> of objects to consider. Passed to <code><a href="../../base/html/exists.html">exists</a></code> and <code><a href="../../base/html/get.html">get</a></code>.</p> </td></tr> <tr valign="top"><td><code>x</code></td> <td> <p>an object of class <code>"ls_str"</code>.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>further arguments to pass. <code>lsf.str</code> passes them to <code>ls.str</code> which passes them on to <code><a href="../../base/html/ls.html">ls</a></code>. The (non-exported) print method <code>print.ls_str</code> passes them to <code><a href="str.html">str</a></code>.</p> </td></tr> <tr valign="top"><td><code>digits</code></td> <td> <p>the number of significant digits to use for printing.</p> </td></tr> </table> <h3>Value</h3> <p><code>ls.str</code> and <code>lsf.str</code> return an object of class <code>"ls_str"</code>, basically the character vector of matching names (functions only for <code>lsf.str</code>), similarly to <code><a href="../../base/html/ls.html">ls</a></code>, with a <code>print()</code> method that calls <code><a href="str.html">str</a>()</code> on each object. </p> <h3>Author(s)</h3> <p>Martin Maechler</p> <h3>See Also</h3> <p><code><a href="str.html">str</a></code>, <code><a href="../../base/html/summary.html">summary</a></code>, <code><a href="../../base/html/args.html">args</a></code>. </p> <h3>Examples</h3> <pre> 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")) </pre> <hr /><div style="text-align: center;">[Package <em>utils</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>