| vignette | R Documentation |
View a specified package vignette, or list the available ones;display it rendered in a viewer, and get or edit itsR source file.
vignette(topic, package = NULL, lib.loc = NULL, all = TRUE)## S3 method for class 'vignette'print(x, ...)## S3 method for class 'vignette'edit(name, ...)
topic | a character string giving the (base) name of the vignetteto view. If omitted, all vignettes from all installed packages arelisted. |
package | a character vector with the names of packages tosearch through, or |
lib.loc | a character vector of directory names ofR libraries,or |
all | logical; if |
x, name | object of class |
... | ignored by the |
Functionvignette returns an object of the same class, theprint method opens a viewer for it.
On Unix-alikes,The program specified by thepdfviewer option is used forviewing PDF versions of vignettes.
If several vignettes have PDF/HTML versions with base name identicaltotopic, 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"packageIQR".
browseVignettes for an HTML-based vignette browser;RShowDoc(<basename>, package = "<pkg>") displays a“rendered” vignette (pdf or html).
## List vignettes from all *attached* packagesvignette(all = FALSE)## List vignettes from all *installed* packages (can take a long time!):vignette(all = TRUE)## The grid intro vignette -- open it## Not run: vignette("grid") # calling print()## The same (conditional on existence of the vignettte).## Note that 'package = *' is much faster in the case of many installed packages:if(!is.null(v1 <- vignette("grid", package="grid"))) {## Not run: v1 # calling print(.) str(v1) ## Now let us have a closer look at the code ## Not run: edit(v1) # e.g., to send lines ...}# if( has vignette "installed")## A package can have more than one vignette (package grid has several):vignette(package = "grid")if(interactive()) { ## vignette("rotated") ## The same, but without searching for it: vignette("rotated", package = "grid")}Add the following code to your website.
For more information on customizing the embed code, readEmbedding Snippets.