[Rd] Detaching one package can remove the S4 methods of another (PR#14087)

ripley at stats.ox.ac.uk ripley at stats.ox.ac.uk
Thu Nov 26 09:15:09 CET 2009


Putting on public record

library(spdep)
showMethods("[")
detach("package:spdep", unload = TRUE)
detach("package:Matrix", unload=TRUE)
showMethods("[") # sp methods still there
detach("package:spam", unload = TRUE)
showMethods("[") # sp methods have gone

This is one of several examples found by package testing in R-devel 
(this one from BayesX) with _R_CHECK_UNLOAD_NAMESPACES_ set.

Session info after the first command:
R version 2.10.0 Patched (2009-11-23 r50545)
x86_64-unknown-linux-gnu

locale:
  [1] LC_CTYPE=en_GB.utf8       LC_NUMERIC=C
  [3] LC_TIME=en_GB.utf8        LC_COLLATE=C
  [5] LC_MONETARY=C             LC_MESSAGES=en_GB.utf8
  [7] LC_PAPER=en_GB.utf8       LC_NAME=C
  [9] LC_ADDRESS=C              LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_GB.utf8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
  [1] spdep_0.4-52       nlme_3.1-96        coda_0.13-4        MASS_7.3-4
  [5] Matrix_0.999375-32 lattice_0.17-26    spam_0.15-5        boot_1.2-41
  [9] maptools_0.7-26    foreign_0.8-38     sp_0.9-47          deldir_0.0-10

loaded via a namespace (and not attached):
[1] grid_2.10.0

Happens also in 2.10.0 and
R version 2.11.0 Under development (unstable) (2009-11-25 r50568)


-- 
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 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-devel mailing list