Sweave provides a misleading error when vignette engine not fully specified

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Sweave provides a misleading error when vignette engine not fully specified

Martin Morgan
Trying to Stangle / Sweave a file

$ cat vignette.Rnw
%\VignetteEngine{knitr}
\documentclass{article}
\begin{document}
\end{document}

results in a misleading error message:

~/tmp$ R CMD Stangle vignette.Rnw
Error: Vignette engine package not specified
Execution halted

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
document.

Also for what its worth Sweave'ing still fails to produce graphics output

https://stat.ethz.ch/pipermail/r-devel/2014-February/068414.html

$ 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)

Martin
--
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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Sweave provides a misleading error when vignette engine not fully specified

Duncan Murdoch-2
On 05/03/2014 11:38 AM, Martin Morgan wrote:

> Trying to Stangle / Sweave a file
>
> $ cat vignette.Rnw
> %\VignetteEngine{knitr}
> \documentclass{article}
> \begin{document}
> \end{document}
>
> 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
> document.
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

Now that sounds unrelated.

Duncan Murdoch
>
> https://stat.ethz.ch/pipermail/r-devel/2014-February/068414.html
>
> $ 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)
>
> Martin

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel