EVOLUTION-MANAGER
Edit File: list.flatten.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: Flatten a nested list to a one-level list</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 list.flatten {rlist}"><tr><td>list.flatten {rlist}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Flatten a nested list to a one-level list</h2> <h3>Description</h3> <p>Flatten a nested list to a one-level list </p> <h3>Usage</h3> <pre> list.flatten(x, use.names = TRUE, classes = "ANY") </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p><code>list</code></p> </td></tr> <tr valign="top"><td><code>use.names</code></td> <td> <p><code>logical</code>. Should the names of <code>x</code> be kept?</p> </td></tr> <tr valign="top"><td><code>classes</code></td> <td> <p>A character vector of class names, or "ANY" to match any class.</p> </td></tr> </table> <h3>Details</h3> <p>The function is essentially a slightly modified version of <code>flatten2</code> provided by Tommy at <a href="https://stackoverflow.com/a/8139959/2906900">stackoverflow.com</a> who has full credit of the implementation of this function. </p> <h3>Author(s)</h3> <p><a href="https://stackoverflow.com/users/662787/tommy">Tommy</a> </p> <h3>Examples</h3> <pre> p <- list(a=1,b=list(b1=2,b2=3),c=list(c1=list(c11='a',c12='x'),c2=3)) list.flatten(p) p <- list(a=1,b=list(x="a",y="b",z=10)) list.flatten(p, classes = "numeric") list.flatten(p, classes = "character") </pre> <hr /><div style="text-align: center;">[Package <em>rlist</em> version 0.4.6.2 <a href="00Index.html">Index</a>]</div> </body></html>