Re^2: Warning in par(args)

Martin Maechler Martin Maechler <maechler@stat.math.ethz.ch>
Thu, 18 Jun 1998 08:43:12 +0200


>>>>> "PD" == Peter Dalgaard BSA <p.dalgaard@biostat.ku.dk> writes:

    PD> Paul Gilbert <pgilbert@bank-banque-canada.ca> writes:

      Paul> I'm getting a lot of warning having to do with setting graphic
      Paul> parameters. I don't recall actually setting any of these, so I
      Paul> would guess they are being set by something I am calling. Has
      Paul> anyone already figured out where this is happening?  ...

      >> Warning in par(args) : parameter "cin" can't be set
      >> Warning in par(args) : parameter "cra" can't be set
      >> Warning in par(args) : parameter "csi" can't be set
      >> Warning in par(args) : parameter "din" can't be set
      Paul> ...

    PD> This comes from constructions of the type

    PD> opar<-par()
    PD> work.work.work()
    PD> par(opar)
Yes.

    PD> This gives complaints from unsettable items. Splus quietly omits them,
    PD> so I suppose that we really should do the same.

By the way, I am the one who made this warning reappear (in src/main/par.c).
It was thought for all the other situations where users
have typos in the "tag" (argument) names, e.g.,

	par(lqd = 3)
or really try to set unsettable par()'s.

I think that currently there's no other easy way to detect user
errors like the above.
However, I agree that we should find a better solution.

I myself am using the (``recommended'' ?) way of

 work.work1()
   on.exit(par(op))
   op <- par(xyx = ...,  brd = ...)
 work.work2()
   op <- c(op, par(ghj = ...,  klm = ...))
 work.work3()

which can be slightly more tedious but is ``preciser'' and doesn't lead to
the above error messages.  

Martin
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._