EVOLUTION-MANAGER
Edit File: list.unzip.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: Transform a list of elements with similar structure into a...</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.unzip {rlist}"><tr><td>list.unzip {rlist}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Transform a list of elements with similar structure into a list of decoupled fields</h2> <h3>Description</h3> <p>Transform a list of elements with similar structure into a list of decoupled fields </p> <h3>Usage</h3> <pre> list.unzip( .data, .fields = c("intersect", "union"), ..., .aggregate = "simplify2array", .missing = NA ) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>.data</code></td> <td> <p>A <code>list</code> of elements containing common fields</p> </td></tr> <tr valign="top"><td><code>.fields</code></td> <td> <p><code>'intersect'</code> to select only common fields for all <code>.data</code>'s elements. <code>'union'</code> to select any field that is defined in any elements in <code>.data</code>.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>The custom aggregate functions. Can be a named list of functions or character vectors. If a function is specified as a list of functions, then the functions will be evaluated recursively on the result of the field. Use <code>identity</code> to avoid aggregating results. Use <code>NULL</code> to remove certain field.</p> </td></tr> <tr valign="top"><td><code>.aggregate</code></td> <td> <p>The default aggregate function, by default, <code>simplify2array</code>. Can be a function, character vector or a list of functions. Use <code>identity</code> to avoid aggregating results.</p> </td></tr> <tr valign="top"><td><code>.missing</code></td> <td> <p>When <code>.fields</code> is <code>'union'</code> and some elements do not contain certain fields, then <code>NULL</code> will be replaced by the value of <code>.missing</code>, by default, <code>NA</code>. This often makes the result more friendly.</p> </td></tr> </table> <h3>See Also</h3> <p><code><a href="list.zip.html">list.zip</a></code> </p> <h3>Examples</h3> <pre> list.unzip(list(p1 = list(a = 1, b = 2), p2 = list(a = 2, b = 3))) list.unzip(list(p1 = list(a = 1, b = 2), p2 = list(a = 2, b = 3, c = 4))) list.unzip(list(p1 = list(a = 1, b = 2), p2 = list(a = 2, b = 3, c = 4)), 'union') list.unzip(list(p1 = list(a = 1, b = 2), p2 = list(a = 2, b = 3, c = 4)), 'union', a = 'identity') list.unzip(list(p1 = list(a = 1, b = 2), p2 = list(a = 2, b = 3, c = 4)), 'intersect', a = NULL) x <- list(april = list(n_days = 30, holidays = list(list('2015-04-01', 'april fools'), list('2015-04-05', 'easter')), month_info = c(number = '4', season = 'spring')), july = list(n_days = 31, holidays = list(list('2014-07-04', 'july 4th')), month_info = c(number = '7', season = 'summer'))) list.unzip(x, holidays = c('list.ungroup', 'unname', 'list.stack', function(df) setNames(df, c("date", "name")))) </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>