\HeaderA{show}{Show an Object}{show}
\aliasA{show,ANY-method}{show}{show,ANY.Rdash.method}
\aliasA{show,classRepresentation-method}{show}{show,classRepresentation.Rdash.method}
\aliasA{show,genericFunction-method}{show}{show,genericFunction.Rdash.method}
\aliasA{show,MethodDefinition-method}{show}{show,MethodDefinition.Rdash.method}
\aliasA{show,MethodWithNext-method}{show}{show,MethodWithNext.Rdash.method}
\aliasA{show,ObjectsWithPackage-method}{show}{show,ObjectsWithPackage.Rdash.method}
\aliasA{show,traceable-method}{show}{show,traceable.Rdash.method}
\aliasA{show-methods}{show}{show.Rdash.methods}
\keyword{programming}{show}
\begin{Description}\relax
Display the object, by printing, plotting or whatever suits its
class.  This function exists to be specialized by methods.  The
default method calls \code{\LinkA{showDefault}{showDefault}}.

Formal methods for \code{show} will
usually be invoked for automatic printing (see the details).
\end{Description}
\begin{Usage}
\begin{verbatim}
show(object)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] Any R object
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Objects from an S4 class (a class defined by a call to
\code{\LinkA{setClass}{setClass}}) will be displayed automatically is if by a
call to \code{show}.  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{\LinkA{print}{print}}.

Methods defined for \code{show} 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} argument to \code{\LinkA{setGeneric}{setGeneric}} and
the discussion in \code{\LinkA{setIs}{setIs}} for the general concept.
\end{Details}
\begin{Value}
\code{show} returns an invisible \code{NULL}.
\end{Value}
\begin{SeeAlso}\relax
\code{\LinkA{showMethods}{showMethods}} prints all the methods for one or more
functions;
\code{\LinkA{showMlist}{showMlist}} prints individual methods lists; 
\code{\LinkA{showClass}{showClass}} prints class definitions.
Neither of the latter two normally needs to be called directly.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
## following the example shown in the setMethod documentation ...
setClass("track",
         representation(x="numeric", y="numeric"))
setClass("trackCurve", 
         representation("track", 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)
\end{ExampleCode}
\end{Examples}

