Re: R-beta: autoloading a required library

Thomas Lumley (thomas@biostat.washington.edu)
Mon, 17 Nov 1997 11:09:25 -0800 (PST)


Date: Mon, 17 Nov 1997 11:09:25 -0800 (PST)
From: Thomas Lumley <thomas@biostat.washington.edu>
To: Albrecht Gebhardt <agebhard@zidsrv.sci.uni-klu.ac.at>
Subject: Re: R-beta: autoloading a required library
In-Reply-To: <Pine.LNX.3.96.971117011450.9537A-100000@alpha.fuzzy.at>

On Mon, 17 Nov 1997, Albrecht Gebhardt wrote:

> 
> I wanted to use the dist() function from the mva library in my own
> library, so I put require(mva) in my files. When my library loads, a
> message about "Autoloading ... mva" appears. But when I call dist() now
> within my functions the message
> 
> Error in .C("dist", as.double(x), nrow(x), ncol(x), double(len),
> as.integer(method)) : C/Fortran function not in load table 
> 
> appears.
> 
> After dyn.load("..._path_to_/mva.so") it works.

It's probably something wrong with the setup, but I don't know what. It
seems to work in my installation of R which is roughly 0.50a4.

Does it work if you use library(mva) instead?  This should be identical
except that it gives an error if "mva" doesn't exist, rather than a
warning.

gorn% R

R : Copyright 1997, Robert Gentleman and Ross Ihaka
Version 0.50 Alpha-4 (September 10, 1997)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type "license()" for details.

[Previously saved workspace restored]

> is.loaded("dist")
[1] FALSE
> require(mva)
Autoloading required library: mva 
[1] TRUE
> is.loaded("dist")
[1] TRUE
> 
and even if the require() is inside a function
> ff<-function(x) require(mva)
> is.loaded("dist")
[1] FALSE
> ff(1)
Autoloading required library: mva 
[1] TRUE
> is.loaded("dist")
[1] TRUE
> 


	-thomas

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=---
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
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=---