The R Project SVN R

Rev

Rev 61433 | Rev 68948 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 61433 Rev 63168
Line 6... Line 6...
6
\name{vignette}
6
\name{vignette}
7
\alias{vignette}
7
\alias{vignette}
8
\alias{edit.vignette}
8
\alias{edit.vignette}
9
\alias{print.vignette}
9
\alias{print.vignette}
10
\alias{vignettes} % to link to from e.g. grid-package.Rd
10
\alias{vignettes} % to link to from e.g. grid-package.Rd
11
\title{View or List Vignettes}
11
\title{View or List Package Vignettes}
12
\description{
12
\description{
13
  View a specified vignette, or list the available ones.
13
  View a specified package vignette, or list the available ones.
14
}
14
}
15
\usage{
15
\usage{
16
vignette(topic, package = NULL, lib.loc = NULL, all = TRUE)
16
vignette(topic, package = NULL, lib.loc = NULL, all = TRUE)
17
 
17
 
18
\S3method{print}{vignette}(x, \dots)
18
\S3method{print}{vignette}(x, \dots)
19
\S3method{edit}{vignette}(name, \dots)
19
\S3method{edit}{vignette}(name, \dots)
20
}
20
}
21
\arguments{
21
\arguments{
22
  \item{topic}{a character string giving the (base) name of the vignette
22
  \item{topic}{a character string giving the (base) name of the vignette
23
    to view. If omitted, all vignettes from all installed packages are listed.}
23
    to view.  If omitted, all vignettes from all installed packages are
-
 
24
    listed.}
24
  \item{package}{a character vector with the names of packages to
25
  \item{package}{a character vector with the names of packages to
25
    search through, or \code{NULL} in which "all" packages (as defined
26
    search through, or \code{NULL} in which \sQuote{all} packages (as
26
    by argument \code{all}) are searched.}
27
    defined by argument \code{all}) are searched.}
27
  \item{lib.loc}{a character vector of directory names of \R libraries,
28
  \item{lib.loc}{a character vector of directory names of \R libraries,
28
    or \code{NULL}.  The default value of \code{NULL} corresponds to all
29
    or \code{NULL}.  The default value of \code{NULL} corresponds to all
29
    libraries currently known.}
30
    libraries currently known.}
30
  \item{all}{logical; if \code{TRUE} search
31
  \item{all}{logical; if \code{TRUE} search all available packages in
31
    all available packages in the library trees specified by \code{lib.loc},
32
    the library trees specified by \code{lib.loc}, and if \code{FALSE},
32
    and if \code{FALSE}, search only attached packages.}
33
    search only attached packages.}
33
  \item{x, name}{Object of class \code{vignette}.}
34
  \item{x, name}{Object of class \code{vignette}.}
34
  \item{\ldots}{Ignored by the \code{print} method, passed on to
35
  \item{\ldots}{Ignored by the \code{print} method, passed on to
35
    \code{\link{file.edit}} by the \code{edit} method.}
36
    \code{\link{file.edit}} by the \code{edit} method.}
36
}
37
}
37
\details{
38
\details{
38
  Function \code{vignette} returns an object of the same class, the
39
  Function \code{vignette} returns an object of the same class, the
39
  print method opens a viewer for it.
40
  print method opens a viewer for it.
40
  Currently, only PDF versions of vignettes can be viewed.
-
 
41
#ifdef unix
41
#ifdef unix
42
  The program specified by the \code{pdfviewer} option is used for this.
42
  The program specified by the \code{pdfviewer} option is used for
-
 
43
  viewing PDF versions of vignettes.
43
#endif
44
#endif
44
  If several vignettes have PDF versions with base name identical to
45
  If several vignettes have PDF/HTML versions with base name identical
45
  \code{topic}, the first one found is used.
46
  to \code{topic}, the first one found is used.
46
 
47
 
47
  If no topics are given, all available vignettes are listed.  The
48
  If no topics are given, all available vignettes are listed.  The
48
  corresponding information is returned in an object of class
49
  corresponding information is returned in an object of class
49
  \code{"packageIQR"}.
50
  \code{"packageIQR"}.
50
 
51
 
51
  The \code{edit} method
-
 
52
  extracts the \R code from the vignette to a temporary file and
52
  The \code{edit} method copies the \R code extracted from the vignette
53
  opens the file in an editor (see \code{\link{edit}}). This makes it
53
  to a temporary file and opens the file in an editor (see
54
  very easy to execute the commands line by line, modify them in any way
54
  \code{\link{edit}}). This makes it very easy to execute the commands
55
  you want to help you test variants, etc.. An alternative way of
-
 
56
  extracting the \R code from the vignette is to run
-
 
57
  \code{\link{Stangle}} on the source code of the vignette,
55
  line by line, modify them in any way you want to help you test
58
  see the examples below.
56
  variants, etc.  
59
}
57
}
60
\seealso{
58
\seealso{
61
  \code{\link{browseVignettes}} for an HTML-based vignette browser.
59
  \code{\link{browseVignettes}} for an HTML-based vignette browser.
62
}
60
}
63
\examples{
61
\examples{
Line 88... Line 86...
88
## The same, but without searching for it:
86
## The same, but without searching for it:
89
vignette("rotated", package = "grid")
87
vignette("rotated", package = "grid")
90
}
88
}
91
}
89
}
92
\keyword{documentation}
90
\keyword{documentation}
93
 
-
 
94
 
-