EVOLUTION-MANAGER
Edit File: show.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: Show an Object</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 show {methods}"><tr><td>show {methods}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Show an Object</h2> <h3>Description</h3> <p>Display the object, by printing, plotting or whatever suits its class. This function exists to be specialized by methods. The default method calls <code><a href="methodUtilities.html">showDefault</a></code>. </p> <p>Formal methods for <code>show</code> will usually be invoked for automatic printing (see the details). </p> <h3>Usage</h3> <pre> show(object) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>object</code></td> <td> <p>Any R object</p> </td></tr> </table> <h3>Details</h3> <p>Objects from an S4 class (a class defined by a call to <code><a href="setClass.html">setClass</a></code>) will be displayed automatically is if by a call to <code>show</code>. S4 objects that occur as attributes of S3 objects will also be displayed in this form; conversely, S3 objects encountered as slots in S4 objects will be printed using the S3 convention, as if by a call to <code><a href="../../base/html/print.html">print</a></code>. </p> <p>Methods defined for <code>show</code> will only be inherited by simple inheritance, since otherwise the method would not receive the complete, original object, with misleading results. See the <code>simpleInheritanceOnly</code> argument to <code><a href="setGeneric.html">setGeneric</a></code> and the discussion in <code><a href="setIs.html">setIs</a></code> for the general concept. </p> <h3>Value</h3> <p><code>show</code> returns an invisible <code>NULL</code>. </p> <h3>See Also</h3> <p><code><a href="showMethods.html">showMethods</a></code> prints all the methods for one or more functions. </p> <h3>Examples</h3> <pre> ## following the example shown in the setMethod documentation ... setClass("track", slots = c(x="numeric", y="numeric")) setClass("trackCurve", contains = "track", slots = c(smooth = "numeric")) t1 <- new("track", x=1:20, y=(1:20)^2) tc1 <- new("trackCurve", t1) setMethod("show", "track", function(object)print(rbind(x = object@x, y=object@y)) ) ## The method will now be used for automatic printing of t1 t1 ## Not run: [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] x 1 2 3 4 5 6 7 8 9 10 11 12 y 1 4 9 16 25 36 49 64 81 100 121 144 [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] x 13 14 15 16 17 18 19 20 y 169 196 225 256 289 324 361 400 ## End(Not run) ## and also for tc1, an object of a class that extends "track" tc1 ## Not run: [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] x 1 2 3 4 5 6 7 8 9 10 11 12 y 1 4 9 16 25 36 49 64 81 100 121 144 [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] x 13 14 15 16 17 18 19 20 y 169 196 225 256 289 324 361 400 ## End(Not run) </pre> <hr /><div style="text-align: center;">[Package <em>methods</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>