R-beta: autoloading a required library

Thomas Lumley thomas at biostat.washington.edu
Mon Nov 17 20:09:25 CET 1997


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 at stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=---



More information about the R-help mailing list