Re: [Rd] default par

From: Greg Snow <>
Date: Tue, 26 Jul 2011 15:31:56 -0600

For number 1, one option is to use the setHook function with the hook in Using this you can create a function that will be called before every new plot is created, your function could then call par with the options that you want, this will set the parameters on all devices. However it could cause problems if you ever wanted to change those values for a plot, your call to par would be overwritten by the hook function.

For number 2, S-PLUS did have the default to warn when points were outside the plotting region, this was annoying when people intentionally used the limits to look at only part of the data, so I don't think it would be popular to bring back this behavior in general. You can use the zoomplot function in the TeachingDemos package to expand the range of your current plot to show data that was outside the limits, or I believe that if you use ggplot2 the plots will be expanded automatically to include all the data (unless you limit the range in the call). You could also write your own points or plot function that would check the range and give warnings then call the regular points or plot function.

Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare

> -----Original Message-----
> From: [mailto:r-devel-bounces@r-
>] On Behalf Of Berry Boessenkool
> Sent: Friday, July 22, 2011 7:47 AM
> To:
> Subject: [Rd] default par
> Hello dear R-developers,
> two questions on an otherwise magnificent program:
> 1)
> Is there a way to set defaults for par differently than R offers
> normally?
> I for example would like to have las default to 1. (or in the same
> style, sometimes type in plot() could be "l" per default).
> Tthe following post desribes pretty much exactly that:
> It was written four years ago, but it seems like there has been no real
> elegant solution.
> Did I just miss something there? If so, could someone give me an
> update?
> If not, is there a chance that such a feature  would be added to future
> R-versions?
> I could live with the idea to assign the par$element default in
> 2)
> Would it appear sensible to have R give a warning, when points() is
> used, and some/all values are out of plotting range in the active
> device?
> It has happened some times that I needed quite a bit of time to figure
> out why nothing was plotted.
> Such a warning (or maybe even a beep?) would give users the clue to
> look at the values right away...
> (What I mean is this:    plot(1:10)  ; points(11,3)    just in case
> it's unclear)
> Thanks ahead for pondering, and again: R ist the most beautiful thing I
> discovered in the last three years.
> Keep up the good work!
> Berry
> -------------------------------------
> Berry Boessenkool
> University of Potsdam, Germany
> -------------------------------------
> ______________________________________________
> mailing list
______________________________________________ mailing list
Received on Tue 26 Jul 2011 - 21:34:32 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 26 Jul 2011 - 21:40:13 GMT.

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

list of date sections of archive