par() applies to the currently open graphics device.
I don't know a way to change the defaults used when a device is first
opened, but you could write a wrapper function to open a device and then
change par().
As for your example code, you need to call the par() function and not
assign to an object of that name. If you had
.First <- function() par(font=2)
it would open a device (a graphsheet in your case) and then change
par("font") on that device, put have no effect on subsquent devices.
On Mon, 6 Mar 2006, Max Zhao wrote:
Dear All,
I am trying to set the default font to 2, instead of the Splus default
1. I tried to put it in my .First function so that every time Splus is
started, the default font would be 2 for each graphic device that is
invoked. Here is what I thought should work, but it did not. Does
anybody know how to solve the question?
################
.First_function()
{
tPar <- par()
tPar$font <- 2
assign("par", tPar)
}
I am using Splus 6.2 in Windows XP environment.
Thanks in advance.
Max
--
Brian D. Ripley, ripley@stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
|