The R Project SVN R

Rev

Rev 68948 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
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{
46128 jmc 58
 Chambers, John M. (2008)
59
 \emph{Software for Data Analysis: Programming with R}
60
  Springer.  (For the R version.)
16371 jmc 61
 
46128 jmc 62
 Chambers, John M. (1998)
63
 \emph{Programming with Data}
64
 Springer (For the original S4 version.)
16371 jmc 65
}
66
\keyword{programming}
67
\keyword{methods}