[Rd] package vignettes build in the same R process?

Martin Morgan mtmorgan at fredhutch.org
Sun Nov 2 01:44:10 CET 2014

If I understand correctly, all vignettes in a package are built in the same R 
process. Global options, loaded packages, etc., in an earlier vignette persist 
in later vignettes. This can introduce user confusion (e.g., when a later 
vignette builds successfully because a package is require()'ed in an earlier 
vignette, but not the current one), difficult-to-identify bugs (e.g., when
a setting in an earlier vignette influences calculation in a latter vignette), 
and misleading information about reproducibility (e.g., when the sessionInfo() 
of a later vignette reflects packages used in earlier vignettes).

I believe the relevant code is at


         output <- tryCatch({
             ## FIXME: run this in a separate process
             engine$weave(file, quiet = quiet)
             find_vignette_product(name, by = "weave", engine = engine)
         }, error = function(e) {
             stop(gettextf("processing vignette '%s' failed with diagnostics:\n%s",
                  file, conditionMessage(e)), domain = NA, call. = FALSE)

Is building of each vignette in separate processes a reasonable feature request?

Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109

Location: Arnold Building M1 B861
Phone: (206) 667-2793

More information about the R-devel mailing list