File: corMatrix.R

package info (click to toggle)
rmatrix 0.999375-43-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 8,068 kB
  • ctags: 2,395
  • sloc: ansic: 37,941; makefile: 216; sh: 128
file content (23 lines) | stat: -rw-r--r-- 674 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#### "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)