Re: [Rd] Generate files for vignettes

From: Duncan Murdoch <>
Date: Tue, 11 Dec 2012 08:52:53 -0500

On 12-12-10 11:45 AM, Benjamin Hofner wrote:
> I am looking for a way to generate files for vignettes.
> The manual "Writing R Extensions" states here [1] in item number 20:
> "If there is a target output file in the vignette source
> directory, the output from running the code in that vignette is compared
> with the target output file."
> Yet, there is no pointer on how to get the correct files for
> vignettes. (For the files in directory "test" there is a footnote on how
> to get the files. [2])

I agree, this should be documented. But it is rather easy:

Just create an empty file and call it Run the checks, and you'll get lots of errors because it won't compare to the real output.

When you get a compare failure, the file vignette.Rnw.log will be left in the *.Rcheck directory. You can just copy that into the file.

Duncan Murdoch

> As a temporary solution, we currently use a script that calls
> tools:::.run_one_vignette() on each vignette and dumps the output:
> echo 'tools:::.run_one_vignette("vignette.Rnw", docDir = ".");' | R
> --vanilla >
> However, this doesn't result in the same code as produced by R CMD
> check. E.g., we get the R startup header and furthermore get the output
> in German where localization is available (thus having differences when
> running R CMD check).
> Does anyone have any hints on how to automatically get the correct
> results (i.e., without the header)? And is it possible to include these
> hints in the "Writing R extensions" manual for other users?
> Any help is highly appreciated.
> Best,
> Benjamin
> --------------------
> [1]
> [2]
> ______________________________________________
> mailing list
> mailing list Received on Tue 11 Dec 2012 - 13:58:27 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 11 Dec 2012 - 15:22:39 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive