SCM

SCM Repository

[matrix] Diff of /pkg/R/zzz.R
ViewVC logotype

Diff of /pkg/R/zzz.R

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 908, Thu Sep 8 15:30:08 2005 UTC revision 956, Fri Sep 30 17:28:00 2005 UTC
# Line 1  Line 1 
1    ### Note that "in theory" even base::as.vector() should be overloaded.
2    ### In practice that could be too much of a performance penalty in some cases.
3    
4  .onLoad <- function(libname, pkgname)  .onLoad <- function(libname, pkgname)
5  {  {
6      ## The following works around namespace-protection on purpose:      ## The following works around namespace-protection on purpose:
7      assignInNamespace("..Old..as.matrix", base::as.matrix, ns = "base")      assignInNamespace("..Old..as.matrix", base::as.matrix, ns = "base")
8        assignInNamespace("..Old..as.array", base::as.array, ns = "base")
9      assignInNamespace("as.matrix", as.matrix, ns = "base")      assignInNamespace("as.matrix", as.matrix, ns = "base")
10        assignInNamespace("as.array", as.array, ns = "base")
11      ## Now all the functions in 'base' that start with something like      ## Now all the functions in 'base' that start with something like
12      ##  "x <- as.matrix(x)"      ##  "x <- as.matrix(x)" or  "X <- as.array(X)"
13      ## will work for 'Matrix'-matrices      ## will work for 'Matrix'-matrices
14    
15      if(paste(R.version$major, R.version$minor, sep=".") >= "2.2")      if(paste(R.version$major, R.version$minor, sep=".") >= "2.2")
# Line 14  Line 19 
19  .onUnload <- function(libpath)  .onUnload <- function(libpath)
20  {  {
21      assignInNamespace("as.matrix", base::..Old..as.matrix, ns = "base")      assignInNamespace("as.matrix", base::..Old..as.matrix, ns = "base")
22        assignInNamespace("as.array",  base::..Old..as.array,  ns = "base")
23      library.dynam.unload("Matrix", libpath)      library.dynam.unload("Matrix", libpath)
24    
25      if(paste(R.version$major, R.version$minor, sep=".") >= "2.2")      if(paste(R.version$major, R.version$minor, sep=".") >= "2.2")

Legend:
Removed from v.908  
changed lines
  Added in v.956

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge