| 42333 |
ripley |
1 |
% File src/library/methods/man/promptMethods.Rd
|
| 68948 |
ripley |
2 |
% Part of the R package, https://www.R-project.org
|
| 74770 |
maechler |
3 |
% Copyright 1995-2018 R Core Team
|
| 42333 |
ripley |
4 |
% Distributed under GPL 2 or later
|
|
|
5 |
|
| 16371 |
jmc |
6 |
\name{promptMethods}
|
| 56186 |
murdoch |
7 |
\alias{promptMethods}
|
| 16371 |
jmc |
8 |
\title{ Generate a Shell for Documentation of Formal Methods }
|
|
|
9 |
\description{
|
|
|
10 |
Generates a shell of documentation for the methods of a generic
|
| 19029 |
hornik |
11 |
function.
|
| 16371 |
jmc |
12 |
}
|
|
|
13 |
\usage{
|
| 25410 |
hornik |
14 |
promptMethods(f, filename = NULL, methods)
|
| 16371 |
jmc |
15 |
}
|
|
|
16 |
\arguments{
|
| 25410 |
hornik |
17 |
\item{f}{a character string naming the generic function whose methods
|
|
|
18 |
are to be documented.}
|
|
|
19 |
\item{filename}{usually, a connection or a character string giving the
|
|
|
20 |
name of the file to which the documentation shell should be written.
|
|
|
21 |
The default corresponds to the coded topic name for these methods
|
|
|
22 |
(currently, \code{f} followed by \code{"-methods.Rd"}). Can also be
|
|
|
23 |
\code{FALSE} or \code{NA} (see below).}
|
| 74770 |
maechler |
24 |
\item{methods}{optional \code{"\linkS4class{listOfMethods}"} object giving the methods to be
|
| 25410 |
hornik |
25 |
documented. By default, the first methods object for this generic
|
|
|
26 |
is used (for example, if the current global environment has some
|
| 21070 |
jmc |
27 |
methods for \code{f}, these would be documented).
|
|
|
28 |
|
| 25410 |
hornik |
29 |
If this argument is supplied, it is likely to be
|
| 74770 |
maechler |
30 |
\code{\link{findMethods}(f, where)}, with \code{where} some package
|
| 25410 |
hornik |
31 |
containing methods for \code{f}.}
|
| 16371 |
jmc |
32 |
}
|
|
|
33 |
\value{
|
| 25410 |
hornik |
34 |
If \code{filename} is \code{FALSE}, the text generated;
|
|
|
35 |
if \code{filename} is \code{NA}, a list-style representation of the
|
|
|
36 |
documentation shell.
|
|
|
37 |
Otherwise, the name of the file written to is returned invisibly.
|
| 16371 |
jmc |
38 |
}
|
| 25410 |
hornik |
39 |
\details{
|
|
|
40 |
If \code{filename} is \code{FALSE}, the text created is returned,
|
|
|
41 |
presumably to be inserted some other documentation file, such as the
|
|
|
42 |
documentation of the generic function itself (see
|
| 61433 |
ripley |
43 |
\code{\link{prompt}}).
|
| 25410 |
hornik |
44 |
|
|
|
45 |
If \code{filename} is \code{NA}, a list-style representation of the
|
|
|
46 |
documentation shell is created and returned. Writing the shell to a
|
|
|
47 |
file amounts to \code{cat(unlist(x), file = filename, sep = "\\n")},
|
|
|
48 |
where \code{x} is the list-style representation.
|
|
|
49 |
|
|
|
50 |
Otherwise, the documentation shell is written to the file specified by
|
|
|
51 |
\code{filename}.
|
|
|
52 |
}
|
| 19029 |
hornik |
53 |
\seealso{
|
|
|
54 |
\code{\link{prompt}} and
|
|
|
55 |
\code{\link{promptClass}}
|
|
|
56 |
}
|
| 16371 |
jmc |
57 |
\references{
|
| 88585 |
hornik |
58 |
\bibshow{R:Chambers:2008}
|
|
|
59 |
(For the R version.)
|
| 16371 |
jmc |
60 |
|
| 88585 |
hornik |
61 |
\bibshow{R:Chambers:1998}
|
|
|
62 |
(For the original S4 version.)
|
| 16371 |
jmc |
63 |
}
|
|
|
64 |
\keyword{programming}
|
|
|
65 |
\keyword{methods}
|