Re: R-alpha: Rv0.13: bug in abline or par2?

Thomas Lumley (thomas@biostat.washington.edu)
Fri, 8 Nov 1996 09:21:10 -0800 (PST)


Date: Fri, 8 Nov 1996 09:21:10 -0800 (PST)
From: Thomas Lumley <thomas@biostat.washington.edu>
To: A.Ledford@surrey.ac.uk
Subject: Re: R-alpha: Rv0.13: bug in abline or par2?
In-Reply-To: <Pine.SOL.3.95.961108130856.10406A-100000@aragorn.mcs.surrey.ac.uk>

On Fri, 8 Nov 1996, Anthony Ledford wrote:
> However, in R v 0.13 I get the following:
> 
>  plot(1:10)
>  abline(h=5)
> Error in par2(args) : parameter "1em" is not setable
>  abline(v=5)
> Error in par2(args) : parameter "1em" is not setable
> 

It appears that the caching of par() commands needed to make print.plot() 
work is going too far.  The following fix appears to work 

gr.settable.pars<-gr.pars[c(2 ,4 ,5 ,7 ,9 ,13,17,20,21,22
,28,33,38,39,40,43,44,45,46,47,48,49)]

"par2" <-  function (...) 
{
	single <- FALSE
	if (nargs() == 0) {
		args <- as.list(gr.settable.pars)
	}
	else {
		args <- list(...)
		if (length(args) == 1) {
			if (is.list(args[[1]]) | is.null(args[[1]])) 
				args <- args[[1]]
			else if (is.null(names(args))) 
				single <- TRUE
		}
	}
	value <- if (single) 
		.Internal(par2(args))[[1]]
	else .Internal(par2(args))
	if (!is.null(names(args))) 
		invisible(value)
	else value
}



thomas lumley
UW biostatistics

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-testers mailing list -- To (un)subscribe, send
subscribe	or	unsubscribe
(in the "body", not the subject !)  To: r-testers-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-