Vignettes in R packages
Contents
I find it very useful to go through vignettes provided by R packages, which help me figure out how to use their functions. For example, the package “dismo”, has a useful vignette named “sdm”, for species distribution modeling.
We use the functions vignette
and edit
to go about this.
For example,
# Vignettes within dismo package
vignette(package = "dismo")
# Opening "sdm" vignette
vignette("sdm", package = "dismo")
# Editing and going through the vignette code
edit(vignette("sdm", package = "dismo"))
# or
v = vignette("sdm", package = "dismo")
edit(v)
# Viewing vignette
print(v)
# Listing vignettes from all attached packages
vignette(all = FALSE)
# Listing vignettes from all installed packages
vignette(all = TRUE)
Thanks to this post from inside-R, which provided an excellent reference when I was searching how to do it.