SCM

SCM Repository

[matrix] View of /pkg/Matrix/R/corMatrix.R
ViewVC logotype

View of /pkg/Matrix/R/corMatrix.R

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2586 - (download) (annotate)
Sun Jul 25 02:32:06 2010 UTC (9 years, 2 months ago) by mmaechler
File size: 674 byte(s)
move Matrix/ directory "down"
#### "corMatrix" (was "correlation" in 2005) ---
#### ----------- correlation matrices, inheriting from  "dpoMatrix"

## dpo* -> cor* is in ./dpoMatrix.R
.M.2cor <- function(from) as(as(from, "dpoMatrix"), "corMatrix")

setAs("Matrix", "corMatrix", .M.2cor)
setAs("matrix", "corMatrix", .M.2cor)

## This is necessary :
setAs("dsyMatrix", "corMatrix", .M.2cor)
## BUT only because __ MM thinks __
## the *automatical* (by inheritance) coercion
### dsyMatrix -> corMatrix coercion is wrong:
## selectMethod(coerce, c("dsyMatrix","corMatrix")) # gives
## function (from, to)
## {
##     obj <- new("corMatrix")
##     as(obj, "dsyMatrix") <- from
##     obj
## }

rm(.M.2cor)

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