[R] start-up problems

Christian Hoffmann christian.hoffmann at wsl.ch
Wed Jun 16 12:04:48 CEST 2004


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

-- 
Dr.sc.math.Christian W. Hoffmann, 
http://www.wsl.ch/staff/christian.hoffmann
Mathematics + Statistical Computing   e-mail: christian.hoffmann at wsl.ch
Swiss Federal Research Institute WSL  Tel: ++41-44-73922-   -77  (office)
CH-8903 Birmensdorf, Switzerland             -11(exchange), -15  (fax)




More information about the R-help mailing list