[Rd] Small inaccuracy in the Writing R Extensions manual

Duncan Murdoch murdoch.duncan at gmail.com
Tue Jan 12 18:42:34 CET 2016


On 12/01/2016 11:11 AM, Berwin A Turlach wrote:
> G'day Duncan,
>
> On Tue, 12 Jan 2016 07:32:05 -0500
> Duncan Murdoch <murdoch.duncan at gmail.com> wrote:
>
> > On 11/01/2016 11:59 PM, Berwin A Turlach wrote:
> > > G'day all,
> > >
> > > In Chapter 1.4 (Writing package vignettes) the Writing R Extensions
> > > manual states:
> > >
> > > 	By default @code{R CMD build} will run @code{Sweave} on all
> > > 	Sweave vignette source files in @file{vignettes}.  If
> > > 	@file{Makefile} is found in the vignette source directory,
> > > then @code{R CMD build} will try to run @command{make} after the
> > > 	@code{Sweave} runs, otherwise @code{texi2pdf} is run on each
> > > 	@file{.tex} file produced.
> > >
> > > This does not seem to be quite correct as stated.  'R CMD build'
> > > seems to run make only if there was a file in the directory
> > > vignettes that Sweave successfully processed.   If the directory
> > > vignettes contains a Makefile and subdirectories in which the
> > > actual vignettes are, 'R CMD build' does not run make.
> > >
> >
> > I think it is behaving as documented:  it says it will run make after
> > Sweave, so if Sweave never ran, neither would make.
>
> Sorry, I disagree.  It says that  "R CMD build will try to run make
> after the Sweave runs".  For me (and probably others) "after the Sweave
> runs" (note the plural) include the cases of "no Sweave runs" and "one
> Sweave run".  Otherwise the case of one vignette in the vignettes
> directory would produce undocumented (albeit expected) behaviour. :-)

Regardless of that, there's a problem if there is no vignette in the 
main directory.  R uses the vignette filename and content to figure out 
which vignette engine to use.  If there's just a Makefile, how would R 
know what to display?  Which .html file or .pdf file corresponds to 
which source file, and where should R go to find the .R file?

So I don't think those things can really be handled as vignettes. They 
can still be handled as  additional files in the inst/doc directory, but 
we probably aren't going to be able to give them full vignette status.

Duncan Murdoch



More information about the R-devel mailing list