[R] Q: calling par() in .First()

D. R. Evans doc.evans at gmail.com
Fri Aug 3 00:58:06 CEST 2007


As a result of another thread here, I need to be sure that the
function par(bg='white') has executed before I create a plot. The
simplest thing seemed to put it in .Rprofile:

.First <- function() {
  options(width=150)
  par(bg='white')
}

But now R complains at startup:
  Error in .First() : couldn't find function "par"

I have confirmed that once R has started, I can type "par(bg='white')"
and R no longer complains.

ISwR has a nice little section on "Using par", but there's no hint
that something like this can go wrong :-(

So what am I not understanding this time?



More information about the R-help mailing list