SCM

SCM Repository

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

View of /pkg/R/zzz.R

Parent Directory Parent Directory | Revision Log Revision Log


Revision 829 - (download) (annotate)
Mon Aug 8 08:21:47 2005 UTC (14 years, 3 months ago) by maechler
File size: 529 byte(s)
re-assign as.matrix() in base (!) -- experimental
.onLoad <- function(libname, pkgname)
{
    ## The following works around namespace-protection on purpose:
    assignInNamespace("..Old..as.matrix", base::as.matrix, ns = "base")
    assignInNamespace("as.matrix", as.matrix, ns = "base")
    ## Now all the functions in 'base' that start with something like
    ##  "x <- as.matrix(x)"
    ## will work for 'Matrix'-matrices
}

.onUnload <- function(libpath)
{
    assignInNamespace("as.matrix", base::..Old..as.matrix, ns = "base")
    library.dynam.unload("Matrix", libpath)
}

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