[Rd] par(ask=T) in termplot() (PR#711)

paradis@isem.univ-montp2.fr paradis@isem.univ-montp2.fr
Fri, 27 Oct 2000 14:48:28 +0200 (MET DST)


At 11:57 25/10/00 +0100, Brian Ripley wrote:
>> Date: mer., 25 oct. 2000 12:38:55 +0200
>> From: Emmanuel Paradis <paradis@isem.univ-montp2.fr>
>
>> I think it would be nice to have par(ask=T) set by default in termplot(),
>> like it is in plot.lm().
>
>Well, it isn't really the default in plot.lm, the default for `ask' being
>
>interactive() && one.fig && length(which) > 1 && .Device != "postscript"
>
>Can you supply us with an appropriate patch for termplot and
>termplot.Rd?  The issue is somewhat subtle.

So plot.lm() sets 'ask=F' if, eg, par(mfcol=c(2,1)) so that the first 2
plots cannot be really visualized. Here is a proposed modification for this
function:

$ diff plot.lm.R plot.lm.new.R
7c7
<          ask = interactive() && one.fig && length(which) > 1
---
>          ask = interactive() && nb.fig < length(which)
52a53
>    nb.fig <- prod(par("mfcol"))



The modification for termplot() follows in the same way:

$ diff termplot.R termplot.new.R
3a4,5
>                      ask = interactive() && nb.fig < n.tms
>          	     && .Device != "postscript",
46a49,55
>     nb.fig <- prod(par("mfcol"))
>     one.fig <- prod(par("mfcol")) == 1
>     if (ask) {
> 	op <- par(ask = TRUE)
> 	on.exit(par(op))
>     }
>     ##---------- Do the individual plots : ----------


I have tested both with R-1.1.1 under WinNT and Solaris2.7, and they seem
to work OK. The corresponding modifications for the .Rd files are:

$ diff plot.lm.Rd plot.lm.new.Rd
11c11
<         ask = interactive() && one.fig && length(which) > 1
---
>         ask = interactive() && one.fig && nb.fig < length(which)

$ bdiff termplot.Rd termplot.new.Rd
11a12,13
>          ask = interactive() && one.fig && nb.fig < length(which)
>          	&& .Device != "postscript",
28a31,32
>   \item{ask}{logical; if \code{TRUE}, the user is \emph{ask}ed before
>     each plot, see \code{\link{par}(ask=.)}.}


Emmanuel Paradis

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._