[R] .First() in R 1.9.0

Roger D. Peng rpeng at jhsph.edu
Fri May 21 14:34:12 CEST 2004


The startup of R has changed in 1.9.0 and x11() and par() are now in 
the `graphics' package.  I think if you precede your calls to x11() 
and par() with library(graphics), it should work.  Or you could run 
graphics::x11() and graphics::par().  This is the blurb from the 1.9.0 
NEWS file:

         Users may notice that code in .Rprofile is run with only the
         new base loaded and so functions may now not be found.  For
         example, ps.options(horizontal = TRUE) should be preceded by
         library(graphics) or called as graphics::ps.options or,
         better, set as a hook -- see ?setHook.

-roger

Timur Elzhov wrote:
> Dear R experts,
> 
> I just upgraded R from 1.8.1 to 1.9.0 version. My .First()
> function in ~/.Rprofile contains x11() and par() functions.
> 
> .First <- function() {
>     x11(display = "", 8.0, 5.0)
>     par(las = 1, ...)
> ##  ...
> }
> 
> And, R claims now, on startup:
> 
>     [hello messages skiped ...]
>     Error in .First() : couldn't find function "x11"
>     >
> 
> I commented "x11" string, and get the same error about par:
>     Error in .First() : couldn't find function "par"
>     > 
> 
> There was no such a problen with previos R version.
> Why .First function knows nothing about "x11" and "par" functions?
> Thanks.
> 
> --
> WBR,
> Timur
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list