2 min read

My first post

While watching the Mariners play this evening, I tried to multitask by also reading the Writing R Extensions manual. I got as far as the second paragraph, which recommends reading up on ?library and ?INSTALL.

I got pretty far through the library docs, including the fact that you can supply help = package to open a basic information page for a package. Running this for dplyr, I noticed it lists package vignettes at the bottom. I tried it again for grid, but did not see any vignettes. Where are my grid vignettes???????????

I turned to ?vignette, where I learned about RShowDoc, which seems to be more-foolproof way of viewing vignettes, perhaps because it tries to read several vignette formats in turn? But vignette() documents itself as also trying to do this. Digging deeper, vignette uses tools::getVignetteInfo, which relies on a vignettes.rds index file which my grid installation doesn’t seem to have (I also noticed that library(help = package) will look for this file as well to print that last vignettes section). In contrast, RShowDoc does not rely on this index file, but instead looks for the vignette file in the doc/ subdirectory of the package directory. The only downside to this is that you need to know the name of the vignettes before appealing to RShowDoc. I’m not sure of a reliable way of acquiring these names other than by running list.files(file.path(find.package("grid"), "doc")). Technically this directory can be fed from inst/doc in the package source too, but RShowDoc doesn’t seem to care where the file in doc/ came from.

From looking at the R source, the grid vignettes do appear to be true vignettes constructed from Sweave source files. So I don’t really know what is up with my R installation, maybe it is because I installed R from Homebrew. And I do really think it is a problem of my installation, because the examples from ?vignette use the grid vignettes.

I’ll take a look at how vignette(package = "grid") performs in my work’s installation of R tomorrow.

In the end, the Mariners won on a walkoff home run :)