I know hese sorts of questions should be addressed directly to the author of the extensions, but since I''m in a bit of a rush, I thought I''d fire this out to the group at large. Furthermore, one of the problems I''m having seems to be indenpendent of the packages themselves (I think, but I''m not sure). When I try to load the library sgeostat, it tries to load the tripack library, but seems to fail. If I try to load the tripack library first, it seems to be unhappy as well, but sgeostat then loads without trouble. I''ll give you examples:> library(sgeostat)Loading required package: mva Loading required package: tripack Error in library.dynam("tripack") : dynamic library `tripack'' not found>library(tripack) >............... or> library(tripack)Error in library.dynam("tripack") : dynamic library `tripack'' not found> library(sgeostat)Loading required package: mva>Does anyone have any idea as to what the problem may be here? The second little problem I''ve been running across is the following. The function dist() is included in the sgeostat library, and at times after I''ve been working away for some time in R, all of a sudden I''m informed that "the function dist() is not found". However, if I type:>distI get a list of all the source code in the function, which tells me that the library is still loaded into memory. Furthermore, typing ">library(sgeostat)" doesn''t seem to reload the library and function. Especially weird is the fact that I can even quit the program, log out, log back in and reload R, and the same error will occur. When this happens, I have to reboot in order to get the library to work properly. Any ideas why such a function might suddenly be no longer available? In closing, I guess I should mention that I''m running R under Linux (Mandrake 7.0) Version 1.0.1 (April 14, 2000). Thanks in advance, Matt -- Matthew Norton nortonm at magellan.umontreal.ca D?pt. des Sciences Biologiques, Universit? de Montr?al C.P. 6128 Succ. centre-ville, Montr?al, Qc H3C 3J7 (514) 343-6111 x1233 __________________________________________________________________ "If we''re going to go down, we''re going to go down fighting; fighting together, fighting each other; fighting somebody." Craig Hartsburg. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Mon, 29 May 2000, Matthew Norton wrote:> I know hese sorts of questions should be addressed directly to the author of > the extensions, but since I''m in a bit of a rush, I thought I''d fire this > out to the group at large. Furthermore, one of the problems I''m having > seems to be indenpendent of the packages themselves (I think, but I''m not > sure).The first thing to establish is theat R CMD check works for all the packages here. If you do that when you install them, you save a lot of future bother. I suspect that it not the case for your installations.> When I try to load the library sgeostat, it tries to load the tripack > library, but seems to fail. If I try to load the tripack library first, it > seems to be unhappy as well, but sgeostat then loads without trouble. I''ll > give you examples: > > > > library(sgeostat) > Loading required package: mva > Loading required package: tripack > Error in library.dynam("tripack") : dynamic library `tripack'' not found > >library(tripack) > > > > ............... or > > > library(tripack) > Error in library.dynam("tripack") : dynamic library `tripack'' not found > > library(sgeostat) > Loading required package: mva > > > > > Does anyone have any idea as to what the problem may be here?No, but it is specific to your system. Did you compile the package yourself? If so, were there any compile warnings? The first thing to check is if the tripack/libs/tripack.so is actually there. If not, go back to installing tripack. I strongly suspect that you are being misled, as loading a package a second time in circumstances like this often appears to succeed, and in fact does nothing.> The second little problem I''ve been running across is the following. The > function dist() is included in the sgeostat library, and at times after > I''ve been working away for some time in R, all of a sudden I''m informed > that "the function dist() is not found". However, if I type:dist in mva, not sgeostat. What informs you? Does example(dist) work, for example?> >dist > > I get a list of all the source code in the function, which tells me that > the library is still loaded into memory. Furthermore, typing > ">library(sgeostat)" doesn''t seem to reload the library and function.It will not reload anything that is already loaded (it thinks).> Especially weird is the fact that I can even quit the program, log out, log > back in and reload R, and the same error will occur. When this happens, I > have to reboot in order to get the library to work properly. Any ideas why > such a function might suddenly be no longer available? > > In closing, I guess I should mention that I''m running R under Linux > (Mandrake 7.0) Version 1.0.1 (April 14, 2000).-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Mon, 29 May 2000, Prof Brian D Ripley wrote:> On Mon, 29 May 2000, Matthew Norton wrote: > > > I know hese sorts of questions should be addressed directly to the author of > > the extensions, but since I''m in a bit of a rush, I thought I''d fire this > > out to the group at large. Furthermore, one of the problems I''m having > > seems to be indenpendent of the packages themselves (I think, but I''m not > > sure). > > ....... > > No, but it is specific to your system. Did you compile the package > yourself? If so, were there any compile warnings? The first thing to > check is if the tripack/libs/tripack.so is actually there. If not, > go back to installing tripack. I strongly suspect that you are being > misled, as loading a package a second time in circumstances like this > often appears to succeed, and in fact does nothing. >I just tried installing tripack on RedHat 6.2 (gcc 2.95.2) into a private R_LIBS dir, the same thing:> library(tripack,lib.loc="~/R-Lib-x86")Error in library.dynam("tripack") : dynamic library `tripack'' not found But> library.dynam("tripack",lib.loc="~/R-Lib-x86")works and after rm(.lib.loc) and setting R_LIBS to "~/R-Lib-x86" it works without errors via> library(tripack)So I guess you may also have some trouble with your R_LIBS variable? Currently I''m doing a .First.lib <- function(lib, pkg) library.dynam("tripack", pkg, lib) in the tripack package. I think I have to modify it so that it works also if called via library(tripack, lib.loc="path/to/somewhere"), any hints? Or is there an error in the library() function not passing its lib.loc argument to subsequent calls? Albrecht PS: it was not exactly the same version of tripack, I will release a new one soon, but I think this doesn''t matter here.> > The second little problem I''ve been running across is the following. The > > .... >...................................................................... | Albrecht Gebhardt Tel.: (++43 463) 2700/832 | | Institut fuer Mathematik Fax : (++43 463) 2700/834 | | Universitaet Klagenfurt mailto:albrecht.gebhardt at uni-klu.ac.at | | Villacher Str. 161 http://www-stat.uni-klu.ac.at/~agebhard | | A-9020 Klagenfurt, Austria | `--------------------------------------------------------------------'' -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Matthew had already said that re-installing solved this for him. On Tue, 30 May 2000, Albrecht Gebhardt wrote:> I just tried installing tripack on RedHat 6.2 (gcc 2.95.2) into a private > R_LIBS dir, the same thing: > > > library(tripack,lib.loc="~/R-Lib-x86") > Error in library.dynam("tripack") : dynamic library `tripack'' not found > > But > > > library.dynam("tripack",lib.loc="~/R-Lib-x86") > > works and after rm(.lib.loc) and setting R_LIBS to "~/R-Lib-x86" it works > without errors via > > > library(tripack) > > So I guess you may also have some trouble with your R_LIBS variable? > > Currently I''m doing a > > .First.lib <- function(lib, pkg) library.dynam("tripack", pkg, lib) > > in the tripack package. I think I have to modify it so that it works also > if called via library(tripack, lib.loc="path/to/somewhere"), any hints?See below.> Or is there an error in the library() function not passing its lib.loc > argument to subsequent calls?It''s your error. You have (version 1.0-3) .First.lib <- function(lib, pkg) library.dynam("tripack", pkg, lib) if(version$minor < "62") library.dynam("tripack") You fail to test for version$major! That the error message you got is not mentioning the other two arguments was a useful hint. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Tue, 30 May 2000, Prof Brian D Ripley wrote:> Matthew had already said that re-installing solved this for him. > > On Tue, 30 May 2000, Albrecht Gebhardt wrote: > > > I just tried installing tripack on RedHat 6.2 (gcc 2.95.2) into a private > > R_LIBS dir, the same thing: > > > > > library(tripack,lib.loc="~/R-Lib-x86") > > Error in library.dynam("tripack") : dynamic library `tripack'' not found > > > > But > > > > > library.dynam("tripack",lib.loc="~/R-Lib-x86") > > > > works and after rm(.lib.loc) and setting R_LIBS to "~/R-Lib-x86" it works > > without errors via > > > > > library(tripack) > > > > So I guess you may also have some trouble with your R_LIBS variable? > > > > Currently I''m doing a > > > > .First.lib <- function(lib, pkg) library.dynam("tripack", pkg, lib) > > > > in the tripack package. I think I have to modify it so that it works also > > if called via library(tripack, lib.loc="path/to/somewhere"), any hints? > > See below. > > > Or is there an error in the library() function not passing its lib.loc > > argument to subsequent calls? > > It''s your error. You have (version 1.0-3) > > First.lib <- function(lib, pkg) library.dynam("tripack", pkg, lib) > > if(version$minor < "62") library.dynam("tripack") > > You fail to test for version$major! > > That the error message you got is not mentioning the other two arguments > was a useful hint.Now I have stolen .First.lib <- function(lib, pkg) { if(version$major==0 && version$minor < 62) stop("This version for R 0.62 or later") library.dynam("tripack", pkg, lib) provide(tripack) } from library(spatial) and library(tripack,lib.loc="path/to/somewhere") works now. Thanks for the hint. But help() still does not find anything about the library in "path/to/somewhere", even if I pass lib.loc="path/to/somewhere" to help. Is still something wrong with my .First.lib function? Albrecht ...................................................................... | Albrecht Gebhardt Tel.: (++43 463) 2700/832 | | Institut fuer Mathematik Fax : (++43 463) 2700/834 | | Universitaet Klagenfurt mailto:albrecht.gebhardt at uni-klu.ac.at | | Villacher Str. 161 http://www-stat.uni-klu.ac.at/~agebhard | | A-9020 Klagenfurt, Austria | `--------------------------------------------------------------------'' -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Tue, 30 May 2000, Albrecht Gebhardt wrote:> Now I have stolen > > .First.lib <- function(lib, pkg) { > if(version$major==0 && version$minor < 62) > stop("This version for R 0.62 or later") > library.dynam("tripack", pkg, lib) > provide(tripack) > } > > from library(spatial) and library(tripack,lib.loc="path/to/somewhere") > works now.Better, just put Depends: R (>0.62) in DESCRIPTION, or just forget about R pre-1.0.0. Package akima has the same problem.> Thanks for the hint. > > But help() still does not find anything about the library in > "path/to/somewhere", even if I pass lib.loc="path/to/somewhere" to help. > Is still something wrong with my .First.lib function?.First.lib is not relevant to help. Have you loaded the package or not? Something like> help(interp, package="akima", lib.loc="/ext/R/library") > help(package="akima", lib.loc="/ext/R/library")works whether it is loaded or not. The semantics of this got changed around 0.99.0 to try to ensure that the help came from loaded libraries. So you can do library(akima, lib.loc="/ext/R/library") ?interp help(interp, package="akima") and you will get the help from the loaded library even if there is a version in the standard library. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Albrecht Gebhardt
2000-May-30 08:24 UTC
[R] help() and lib.loc (was Re: question about sgeostat)
On Tue, 30 May 2000, Prof Brian D Ripley wrote:> On Tue, 30 May 2000, Albrecht Gebhardt wrote: > > > Now I have stolen > > > > .First.lib <- function(lib, pkg) { > > if(version$major==0 && version$minor < 62) > > stop("This version for R 0.62 or later") > > library.dynam("tripack", pkg, lib) > > provide(tripack) > > } > > > > from library(spatial) and library(tripack,lib.loc="path/to/somewhere") > > works now. > .... > > > > But help() still does not find anything about the library in > > "path/to/somewhere", even if I pass lib.loc="path/to/somewhere" to help. > > Is still something wrong with my .First.lib function? > > First.lib is not relevant to help. Have you loaded the package or not?yes, loaded.> Something like > > > help(interp, package="akima", lib.loc="/ext/R/library") > > help(package="akima", lib.loc="/ext/R/library") > > works whether it is loaded or not. The semantics of this got changed > around 0.99.0 to try to ensure that the help came from loaded libraries. > So you can do > > library(akima, lib.loc="/ext/R/library") > ?interp > help(interp, package="akima") > > and you will get the help from the loaded library even if there is > a version in the standard library. > > -- > Brian D. Ripley, ripley at stats.ox.ac.uk > Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ > University of Oxford, Tel: +44 1865 272861 (self) > 1 South Parks Road, +44 1865 272860 (secr) > Oxford OX1 3TG, UK Fax: +44 1865 272595Ok, now without loading the library: ... [Previously saved workspace restored]> help(tri.mesh)Error in help(tri.mesh) : No documentation for `tri.mesh''> help(tri.mesh, package="tripack", lib.loc="~/R-Lib-x86/")Error in help(tri.mesh, package = "tripack", lib.loc = "~/R-Lib-x86/") : No documentation for `tri.mesh''> help(tri.mesh, package="tripack", lib.loc="/home/users/agebhard/R-Lib-x86/")... works So it seems the lib.loc path contents in library() and help() gets parsed differently: library() knows about the expansion of "~" to the $HOME variable (because library(tripack,lib.loc="~/R-Lib-x86/") works) but help() does not. Albrecht ...................................................................... | Albrecht Gebhardt Tel.: (++43 463) 2700/832 | | Institut fuer Mathematik Fax : (++43 463) 2700/834 | | Universitaet Klagenfurt mailto:albrecht.gebhardt at uni-klu.ac.at | | Villacher Str. 161 http://www-stat.uni-klu.ac.at/~agebhard | | A-9020 Klagenfurt, Austria | `--------------------------------------------------------------------'' -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>>>>> "Matthew" == Matthew Norton <nortonm at magellan.umontreal.ca> writes:Matthew> I know hese sorts of questions should be addressed directly to Matthew> the author of the extensions, but since I''m in a bit of a Matthew> rush, I thought I''d fire this out to the group at large. Matthew> Furthermore, one of the problems I''m having seems to be Matthew> indenpendent of the packages themselves (I think, but I''m not Matthew> sure). Matthew> When I try to load the library sgeostat, it tries to load the Matthew> tripack library, but seems to fail. If I try to load the Matthew> tripack library first, it seems to be unhappy as well, but Matthew> sgeostat then loads without trouble. I''ll give you examples: >> library(sgeostat) Matthew> Loading required package: mva Loading required package: Matthew> tripack Error in library.dynam("tripack") : dynamic library Matthew> `tripack'' not found >> library(tripack) >> Matthew> ............... or >> library(tripack) Matthew> Error in library.dynam("tripack") : dynamic library `tripack'' Matthew> not found >> library(sgeostat) Matthew> Loading required package: mva >> Matthew> Does anyone have any idea as to what the problem may be here? I think "Yes": you''ve encountered a long-standing "design bug" here -- it''s good time to be reminded of it ! The first time tripack "is tried to be loaded" it ends, not finding the "*.DLL/*.so library" file with the compiled code --- but it is still attached to the search() path (i.e. ` search()[2] '' will give "package:tripack" ) Hence, the second time it is required, nothing happens since library() / require() finds that the tripack package is already present and will not do anything. --> another problem to be fixed hopefully for R 1.1.0 Martin Maechler <maechler at stat.math.ethz.ch> http://stat.ethz.ch/~maechler/ Seminar fuer Statistik, ETH-Zentrum LEO D10 Leonhardstr. 27 ETH (Federal Inst. Technology) 8092 Zurich SWITZERLAND phone: x-41-1-632-3408 fax: ...-1228 <>< -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Prof Brian D Ripley
2000-May-30 10:25 UTC
[R] help() and lib.loc (was Re: question about sgeostat)
On Tue, 30 May 2000, Albrecht Gebhardt wrote:> > help(tri.mesh) > Error in help(tri.mesh) : No documentation for `tri.mesh'' > > help(tri.mesh, package="tripack", lib.loc="~/R-Lib-x86/") > Error in help(tri.mesh, package = "tripack", lib.loc = "~/R-Lib-x86/") : > No documentation for `tri.mesh'' > > help(tri.mesh, package="tripack", lib.loc="/home/users/agebhard/R-Lib-x86/") > ... works > > So it seems the lib.loc path contents in library() and help() gets parsed > differently: > > library() knows about the expansion of "~" to the $HOME variable (because > library(tripack,lib.loc="~/R-Lib-x86/") works) but help() does not.Yes. As "~" is a csh construct, and not in general a valid part of a path, it is just chance that it works for library. index.search(), the tool used by help, does not know about "~". sys.source() as used by library () does. I''ll see if I can add "~" to the knowledge of index.search. Generally, though, don''t assume that packages know about csh''s shortcuts. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._