[R] start-up problems

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Jun 16 12:50:20 CEST 2004


Please do read the NEWS file.  help.start is in package utils, and that is
not available when .Rprofile is run.  Similarly for x11 and package
graphics.  This and the workarounds are described in the NEWS file for
1.9.0.

On Wed, 16 Jun 2004, Christian Hoffmann wrote:

> Hi,
> 
> After some reading and experimentation I found that I cannot solve this 
> problem:
> 
> 1.
> I am starting R and check:
> 
>  > system("pwd")
> /home/woodstock/hoffmacw/R/test
>  > system("echo $HOME")
> /home/woodstock/hoffmacw
>  > system("echo $R_PROFILE")
> /home/woodstock/hoffmacw/R
>  > system("ls $R_PROFILE/.Rprofile")
> /home/woodstock/hoffmacw/R/.Rprofile
>  > system("cat $R_PROFILE/.Rprofile")   # gives
> 
>   system("pwd")
>   (editedOn <- "2004-06-15, 11:10")
> 
> .Last  <- function() {
> 	cat("Adieu, delete all ps.out.*.ps files\n")
> 	system("rm -f ps.out.*.ps")
> 	system(" \n")
> }
> .First <- function() {
>    options(digits=6)
>    library(MASS)
>    help.start()
>    x11(display = "", width = 9, height = 7, pointsize = 12, gamma = 1, 
> colortype = getOption("X11colortype"), maxcubesize = 256)
> }
>  >
> 
> Now
> 
>  > source("$R_PROFILE/.Rprofile")
> Error in file(file, "r") : unable to open connection
> In addition: Warning message:
> cannot open file `$R_PROFILE/.Rprofile'
>  >
> 
> but
> 
>  > source("~/R/.Rprofile")
> /home/woodstock/hoffmacw/R/test
>  >
> 
> This does IMHO not explain why .Rprofile is not being sourced at 
> startup. help.start and x11 are *not* executed, of course.
> 
> Is there an unseen obstacle?
> 
> 
> 2.
> When I manually source("~/R/.Rprofile"), after exiting and saving the 
> work space, and restarting R I get:
> 
> R : Copyright 2004, The R Foundation for Statistical Computing
> Version 1.9.0  (2004-04-12), ISBN 3-900051-00-3
> ....
> [Previously saved workspace restored]
> 
> Loading required package: stats
> Error in .First() : couldn't find function "help.start"
>  > options(STERM='iESS', editor='emacsclient')
>  >
> 
> Not finding  help.start is puzzling! Because of this error, x11 would 
> not start. Exchanging the lines with help.start and x11 would just 
> result in not finding x11!
> 
> 
> Yet doing a manual
>  > help.start()
> is possible.
> 
> Sorry for the lengthy description, but perhaps there is quite a simple 
> reason for this misbehaviour.
> 
> Christian
> 
> 

-- 
Brian D. Ripley,                  ripley at 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




More information about the R-help mailing list