From: wolski (wolski@molgen.mpg.de)
Date: Tue 30 Dec 2003 - 22:51:42 EST
Message-id: <200312301251420683.03AF7394@harry.molgen.mpg.de>
Hi!
The writing R extension states.
"The shared object/DLL is loaded by dyn.load and unloaded by dyn.unload. Unloading
is not normally necessary, but it is needed to allow the DLL to be re-built on some platforms,
including Windows."
I am working on Windows.
I load the dll as described in R-exts with
.First.lib <- function(lib, pkg) library.dynam("mscalibD",pkg,lib)
in the zzz.R file.
After starting R and loading the package with
library(mscalibD)
>library.dynam()
[1] "ts" "nls" "modreg" "mva" "ctest" "methods" "mscalibD"
> dyn.unload("D:/prog/R/rw1081/library/mscalibD/libs/mscalibD.dll")
Error in dyn.unload(x) : dynamic/shared library "D:/prog/R/rw1081/library/mscalibD/libs/mscalibD.dll" was not loaded
But
> dyn.load("D:/prog/R/rw1081/library/mscalibD/libs/mscalibD.dll")
> dyn.unload("D:/prog/R/rw1081/library/mscalibD/libs/mscalibD.dll")
works.
So i guess that dyn.unload isn't supposed to work together with library.dynam. Is this right?
I guess also that I should use instead
.Last.lib<-funciton(libpath) library.dynam.unload("mscalibD", libpath)
Is this right? If so where I have to place this function? In the zzz.R?
And how to call it from within R? Is it called by detach()?
> detach(package:mva)
> is.loaded(symbol.For("hcass2"))
[1] TRUE
I gues no. Because as dyn.load {base} example section states
is.loaded(symbol.For("hcass2")) #-> probably TRUE, as mva is loaded.
The help is mind boggling. Please help!
Eryk
______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
This archive was generated by hypermail 2.1.3 : Thu 01 Jan 2004 - 09:21:04 EST