EVOLUTION-MANAGER
Edit File: char.expand.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: Expand a String with Respect to a Target Table</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 char.expand {base}"><tr><td>char.expand {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Expand a String with Respect to a Target Table</h2> <h3>Description</h3> <p>Seeks a unique match of its first argument among the elements of its second. If successful, it returns this element; otherwise, it performs an action specified by the third argument. </p> <h3>Usage</h3> <pre>char.expand(input, target, nomatch = stop("no match"))</pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>input</code></td> <td> <p>a character string to be expanded.</p> </td></tr> <tr valign="top"><td><code>target</code></td> <td> <p>a character vector with the values to be matched against.</p> </td></tr> <tr valign="top"><td><code>nomatch</code></td> <td> <p>an <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> expression to be evaluated in case expansion was not possible.</p> </td></tr> </table> <h3>Details</h3> <p>This function is particularly useful when abbreviations are allowed in function arguments, and need to be uniquely expanded with respect to a target table of possible values. </p> <h3>Value</h3> <p>A length-one character vector, one of the elements of <code>target</code> (unless <code>nomatch</code> is changed to be a non-error, when it can be a zero-length character string). </p> <h3>See Also</h3> <p><code><a href="charmatch.html">charmatch</a></code> and <code><a href="pmatch.html">pmatch</a></code> for performing partial string matching. </p> <h3>Examples</h3> <pre> locPars <- c("mean", "median", "mode") char.expand("me", locPars, warning("Could not expand!")) char.expand("mo", locPars) </pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>