\HeaderA{method.skeleton}{Create a Skeleton File for a New Method}{method.skeleton}
\keyword{programming}{method.skeleton}
\keyword{methods}{method.skeleton}
\begin{Description}\relax
This function writes a source file containing a call to
\code{\LinkA{setMethod}{setMethod}} to define a method for the generic function
and signature supplied.  By default the method definition is in line
in the call, but can be made an external (previously assigned) function.
\end{Description}
\begin{Usage}
\begin{verbatim}
method.skeleton(generic, signature, file, external = FALSE, where)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{generic}] the character string name of the generic function, or
the generic function itself.  In the first case, the function
need not currently be a generic, as it would not for the
resulting call to \code{\LinkA{setMethod}{setMethod}}.
\item[\code{signature}] the method signature, as it would be given to \code{\LinkA{setMethod}{setMethod}}
\item[\code{file}] a character string name for the output file, or a
writable connection.  By default the generic function name and
the classes in the signature are concatenated, with separating
underscore characters.  The file name should normally end in \code{".R"}. 
\item[\code{external}] flag to control whether the function definition for
the method should be a separate external object assigned in the
source file, or included in line in the call to
\code{\LinkA{setMethod}{setMethod}}.
If supplied as a character string, this will be used as the name
for the external function; by default the name concatenates the
generic and signature names, with separating underscores.
\item[\code{where}] The environment in which to look for the function; by default,
the top-level environment of the call to \code{method.skeleton}.
\end{ldescription}
\end{Arguments}
\begin{Value}
The \code{file} argument, invisibly, but the function is used for its side effect.
\end{Value}
\begin{SeeAlso}\relax
\code{\LinkA{setMethod}{setMethod}}, \code{\LinkA{package.skeleton}{package.skeleton}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}

setClass("track", representation(x ="numeric", y="numeric"))
method.skeleton("show", "track")            ## writes show_track.R
method.skeleton("Ops", c("track", "track")) ## writes "Ops_track_track.R"

## write multiple method skeletons to one file
con <- file("./Math_track.R", "w")
method.skeleton("Math", "track", con)
method.skeleton("exp", "track", con)
method.skeleton("log", "track", con)
close(con)

\end{ExampleCode}
\end{Examples}

