Re: R-beta: survival4

Douglas Bates (bates@stat.wisc.edu)
27 Jan 1998 09:04:19 -0600


To: "Buyukisik, Osman (GEAE)" <Osman.Buyukisik@ae.ge.com>
Subject: Re: R-beta: survival4
From: Douglas Bates <bates@stat.wisc.edu>
Date: 27 Jan 1998 09:04:19 -0600
In-Reply-To: "Buyukisik, Osman's message of Tue, 27 Jan 1998 08:12:05 -0500

"Buyukisik, Osman (GEAE)" <Osman.Buyukisik@ae.ge.com> writes:

> Hmm... I have the same problem on hpux10.20. I put the additional libs into a
> subdir called contrib, and R INSTALL from there. I have R-0.61.1 Alpha Dec21
> 1997. Without restored data they work OK.
> Osman
> 
> > ----------
> > From: 	Goran Brostrom[SMTP:gb@stat.umu.se]
> > Sent: 	Tuesday, January 27, 1998 3:07 AM
> > To: 	r-help@stat.math.ethz.ch
> > Subject: 	R-beta: survival4
> > 
> > 
> > I have installed R (latest) on two machines running RedHat Linux,
> > Versions 4.2 and 5.0, respectively. In both cases I get the 
> > following error: Starting R in an empty (ie, no .RData file) folder
> > is fine, coxph works, but if I quit, save the work sheet and 
> > start R again I get a "not in load table" error. See below.

I believe there is a lingering problem in the 0.61 version of R that
the list of shared objects that have been loaded by the library.dynam
function is stored in .Rdata.  It should not be stored there, it
should be in the "session data" (whatever that is called).

That is, library.dynam currently reads as
 > library.dynam
 function (name, package = .packages(), lib.loc = .lib.loc) 
 {
	 if (!exists(".Dyn.libs")) 
		 assign(".Dyn.libs", character(0), envir = .GlobalEnv)
	 LEN <- nchar(name)
	 if (substr(name, LEN - 2, LEN) == ".so") {
		 name <- substr(name, 1, LEN - 3)
	 }
	 if (is.na(match(name, .Dyn.libs))) {
		 file <- system.file(paste("libs", "/", name, 
			 ".", "so", sep = ""), package, lib.loc)
		 if (file == "") {
			 stop(paste("dynamic library `", name, 
				 "' not found", sep = ""))
		 }
		 .Internal(dyn.load(file))
		 assign(".Dyn.libs", c(.Dyn.libs, name), envir = .GlobalEnv)
	 }
	 invisible(.Dyn.libs)
 }

but those assignments of the ".Dyn.libs" should not take place in the
..GlobalEnv because they get restored at the next session even though
the libraries have not been loaded.

A temporary fix for this might be to create a .First function (if you
don't already have one) and add
 remove(".Dyn.libs", envir=.GlobalEnv)
to it.
-- 
Douglas Bates                            bates@stat.wisc.edu
Statistics Department                    608/262-2598
University of Wisconsin - Madison        http://www.stat.wisc.edu/~bates/
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._