~/tmp$ R CMD Stangle vignette.Rnw
Error: Vignette engine package not specified
when what is missing is the full specification knitr::knitr; 'vignette engine
package and function not specified' ? Also it's somehow unfortunate that the
vignette builds when in a package/vignettes directory, but not as a stand-alone
Also for what its worth Sweave'ing still fails to produce graphics output
$ R --version|head -n 3
R Under development (unstable) (2014-03-05 r65124) -- "Unsuffered Consequences"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: x86_64-unknown-linux-gnu (64-bit)
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
Re: Sweave provides a misleading error when vignette engine not fully specified
On 05/03/2014 11:38 AM, Martin Morgan wrote:
> Trying to Stangle / Sweave a file
> $ cat vignette.Rnw
> results in a misleading error message:
> ~/tmp$ R CMD Stangle vignette.Rnw
> Error: Vignette engine package not specified
> Execution halted
I don't see that as misleading. The code can't figure out where the
knitr engine comes from, and it's telling you that.
> when what is missing is the full specification knitr::knitr; 'vignette engine
> package and function not specified' ? Also it's somehow unfortunate that the
> vignette builds when in a package/vignettes directory, but not as a stand-alone
A package can declare the vignette building package in its DESCRIPTION
file. If it's a standalone Sweave document, it needs to be declared in
the document itself. (It's also possible to declare it on the Stangle
command line, but you'll still need the fully qualified name, e.g.
R CMD Stangle --engine=knitr::knitr vignette.Rnw
It might be possible to set up R to automatically load knitr first (e.g.
by putting it in your list of R_DEFAULT_PACKAGES); I haven't tried
that. But somehow you need to tell R where the knitr engine lives.
> Also for what its worth Sweave'ing still fails to produce graphics output