EVOLUTION-MANAGER
Edit File: op-get-attr.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: Infix attribute accessor and setter</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 op-get-attr {rlang}"><tr><td>op-get-attr {rlang}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Infix attribute accessor and setter</h2> <h3>Description</h3> <p>This operator extracts or sets attributes for regular objects and S4 fields for S4 objects. </p> <h3>Usage</h3> <pre> x %@% name x %@% name <- value </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>Object</p> </td></tr> <tr valign="top"><td><code>name</code></td> <td> <p>Attribute name</p> </td></tr> <tr valign="top"><td><code>value</code></td> <td> <p>New value for attribute <code>name</code>.</p> </td></tr> </table> <h3>Examples</h3> <pre> # Unlike `@`, this operator extracts attributes for any kind of # objects: factor(1:3) %@% "levels" mtcars %@% class mtcars %@% class <- NULL mtcars # It also works on S4 objects: .Person <- setClass("Person", slots = c(name = "character", species = "character")) fievel <- .Person(name = "Fievel", species = "mouse") fievel %@% name </pre> <hr /><div style="text-align: center;">[Package <em>rlang</em> version 1.0.6 <a href="00Index.html">Index</a>]</div> </body></html>