EVOLUTION-MANAGER
Edit File: rename.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: Modify names by name, not position.</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 rename {plyr}"><tr><td>rename {plyr}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Modify names by name, not position.</h2> <h3>Description</h3> <p>Modify names by name, not position. </p> <h3>Usage</h3> <pre> rename(x, replace, warn_missing = TRUE, warn_duplicated = TRUE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>named object to modify</p> </td></tr> <tr valign="top"><td><code>replace</code></td> <td> <p>named character vector, with new names as values, and old names as names.</p> </td></tr> <tr valign="top"><td><code>warn_missing</code></td> <td> <p>print a message if any of the old names are not actually present in <code>x</code>.</p> </td></tr> <tr valign="top"><td><code>warn_duplicated</code></td> <td> <p>print a message if any name appears more than once in <code>x</code> after the operation. Note: x is not altered: To save the result, you need to copy the returned data into a variable.</p> </td></tr> </table> <h3>Examples</h3> <pre> x <- c("a" = 1, "b" = 2, d = 3, 4) # Rename column d to "c", updating the variable "x" with the result x <- rename(x, replace = c("d" = "c")) x # Rename column "disp" to "displacement" rename(mtcars, c("disp" = "displacement")) </pre> <hr /><div style="text-align: center;">[Package <em>plyr</em> version 1.8.7 <a href="00Index.html">Index</a>]</div> </body></html>