EVOLUTION-MANAGER
Edit File: list.update.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: Update a list by appending or modifying its elements.</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.update {rlist}"><tr><td>list.update {rlist}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Update a list by appending or modifying its elements.</h2> <h3>Description</h3> <p>The function updates each element of a list by evaluating a group of expressions in the scope of the element. If the name of an expression alreadys exists in an list element, then the field with the name will be updated. Otherwise, the value with the name will be appended to the list element. The functionality is essentially done by <code>modifyList</code>. </p> <h3>Usage</h3> <pre> list.update(.data, ..., keep.null = FALSE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>.data</code></td> <td> <p><code>list</code></p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>A group of labmda expressions</p> </td></tr> <tr valign="top"><td><code>keep.null</code></td> <td> <p>Should <code>NULL</code> values be preserved for <code>modifyList</code></p> </td></tr> </table> <h3>Examples</h3> <pre> x <- list(p1 = list(type='A',score=list(c1=10,c2=8)), p2 = list(type='B',score=list(c1=9,c2=9)), p3 = list(type='B',score=list(c1=9,c2=7))) list.update(x, high=max(score$c1,score$c2), low=min(score$c1,score$c2)) list.update(x, exams=length(score)) list.update(x, grade=ifelse(type=='A', score$c1, score$c2)) list.update(x, score=list(min=0, max=10)) </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>