[Bioc-devel] "R CMD check" and par(mfrow=…) in vignettes

Martin Morgan mtmorgan at fhcrc.org
Wed Aug 7 14:14:35 CEST 2013

On 08/06/2013 05:25 AM, Wolfgang Huber wrote:
> Hi
> one of my packages [1] has several places in its vignette where multi-panel figures are generated via the likes of "par(mfrow=c(4,2))" within <<fig=TRUE>> code chunks. The package builds fine with 'R CMD build', and the vignette builds fine when calling Sweave manually. However, 'R CMD check' fails with
> * checking running R code from vignettes ...
>     ‘Hiiragi2013.Rnw’ ... failed
> Errors in running code in vignettes:
> [..snip..]
>    When sourcing ‘Hiiragi2013.R’:
> Error: figure margins too large
> I believe this is because R CMD check calls Stangle on the .Rnw and then sources the .R file disregarding any device size settings. I can think of several ways to work around this, but this seems like a rather basic deficiency of the current system that asks for a more generic answer. Does anybody have any insight here?

I guess these qualify as work-arounds

1. From ?RweaveLatex, \setkeys{Gin}{width=\textwidth} though this doesn't 
actually help much

2. par(mfrow=c(7,5), mar=par("mar")/2)

3. output to pdf and then include separately

   pdf("foo.pdf", ...)


Not sure what you had in mind for a generic solution?


> 	Best wishes
> 	Wolfgang
> PS I am sorry if this has been discussed elsewhere, but digging in the R-exts manual and in Google did not turn up a solution for me.
> [1] https://hedgehog.fhcrc.org/bioc-data/trunk/experiment/pkg/Hiiragi2013
> _______________________________________________
> Bioc-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel

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 Bioc-devel mailing list