EVOLUTION-MANAGER
Edit File: tryGet.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: Try to get the value of a symbol if exists or return 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 tryGet {rlist}"><tr><td>tryGet {rlist}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Try to get the value of a symbol if exists or return a default value</h2> <h3>Description</h3> <p>Try to get the value of a symbol if exists or return a default value </p> <h3>Usage</h3> <pre> tryGet(symbol, def = NULL, ..., envir = parent.frame()) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>symbol</code></td> <td> <p>the symbol to examine</p> </td></tr> <tr valign="top"><td><code>def</code></td> <td> <p>the default value if the symbol does not exist</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>additional parameters passed to <code>exists</code> and <code>get</code></p> </td></tr> <tr valign="top"><td><code>envir</code></td> <td> <p>the environment to examine whether the symbol exists and get the symbol</p> </td></tr> </table> <h3>Details</h3> <p>By default, the symbol is examined in <code>envir</code> without inheritance, that is, if the symbol does not exist in <code>envir</code> the default value <code>def</code> will be returned. </p> <h3>Examples</h3> <pre> x <- list(a=c(x=1,y=2),b=c(x=2,p=3)) list.map(x, tryGet(y,0)) </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>