Rev 68948 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File src/library/utils/man/vignette.Rd% Part of the R package, https://www.R-project.org% Copyright 1995-2013 R Core Team% Distributed under GPL 2 or later\name{vignette}\alias{vignette}\alias{edit.vignette}\alias{print.vignette}\alias{vignettes} % to link to from e.g. grid-package.Rd\title{View or List Package Vignettes}\description{View a specified package vignette, or list the available ones.}\usage{vignette(topic, package = NULL, lib.loc = NULL, all = TRUE)\S3method{print}{vignette}(x, \dots)\S3method{edit}{vignette}(name, \dots)}\arguments{\item{topic}{a character string giving the (base) name of the vignetteto view. If omitted, all vignettes from all installed packages arelisted.}\item{package}{a character vector with the names of packages tosearch through, or \code{NULL} in which \sQuote{all} packages (asdefined by argument \code{all}) are searched.}\item{lib.loc}{a character vector of directory names of \R libraries,or \code{NULL}. The default value of \code{NULL} corresponds to alllibraries currently known.}\item{all}{logical; if \code{TRUE} search all available packages inthe library trees specified by \code{lib.loc}, and if \code{FALSE},search only attached packages.}\item{x, name}{Object of class \code{vignette}.}\item{\ldots}{Ignored by the \code{print} method, passed on to\code{\link{file.edit}} by the \code{edit} method.}}\details{Function \code{vignette} returns an object of the same class, theprint method opens a viewer for it.#ifdef unixThe program specified by the \code{pdfviewer} option is used forviewing PDF versions of vignettes.#endifIf several vignettes have PDF/HTML versions with base name identicalto \code{topic}, the first one found is used.If no topics are given, all available vignettes are listed. Thecorresponding information is returned in an object of class\code{"packageIQR"}.The \code{edit} method copies the \R code extracted from the vignetteto a temporary file and opens the file in an editor (see\code{\link{edit}}). This makes it very easy to execute the commandsline by line, modify them in any way you want to help you testvariants, etc.}\seealso{\code{\link{browseVignettes}} for an HTML-based vignette browser.}\examples{## List vignettes from all *attached* packagesvignette(all = FALSE)## List vignettes from all *installed* packages (can take a long time!):vignette(all = TRUE)\dontrun{## Open the grid intro vignettevignette("grid")## The samev1 <- vignette("grid")print(v1)## Now let us have a closer look at the codeedit(v1)## An alternative way of extracting the code,## R file is written to current working directoryStangle(v1$file)## A package can have more than one vignette (package grid has several):vignette(package = "grid")vignette("rotated")## The same, but without searching for it:vignette("rotated", package = "grid")}}\keyword{documentation}