| SM2SM | R Documentation |
ASM is a sparse matrix object containing: nr = number of rows, nc = number of columns, ra = nonzero coeff, ia = row indices, ja = col indices, SMM = space matrix method, ZINDEX=use 0-indexing
SM2SM(ASM, SMM2 = "CRI", ZINDEX2 = FALSE, NA_flag = (-1e+12))
ASM |
A sparse matrix object |
SMM2 |
sparse matrix method with SMM2 ='A','CRI','RCI','CMO',or'RMO' |
ZINDEX2 |
T = Use zero indexing or F = Use one indexing. |
NA_flag |
Number to uses as NA flag |
A list object containing the following sparse matrix components:
nnz = the number of non-zero elements in ra.
nr = the number of rows in matrix.
nc = the number of columns in matrix.
ia = the revised row index.
ja = the revised column index.
rnames = row names – may be missing or ""
cnames = column names – may be missing or ""
ra = the revised non-zero coefficients in A
SMM = the revised sparse matrix type.
ZINDEX = TRUE or F for the revised sparse form.
(A = matrix(c(1,0,0,2,0,3,1,0,0,5,0,6),3,4,byrow=TRUE))
(ASM1 = A2SM(A,SMM='CMO',ZINDEX=TRUE))
(ASM2 = SM2SM(ASM1,SMM2='CRI',ZINDEX2=FALSE))
SM2A(ASM1)
SM2A(ASM2)
(A = matrix(c(1,0,0,2,0,3,1,0,0,5,0,6),3,4,byrow=TRUE)); A[2,3]=NA; A
(ASM1 = A2SM(A,SMM='CMO',ZINDEX=TRUE)); SM2A(ASM1)
(ASM2 = SM2SM(ASM1,SMM2='CRI',ZINDEX2=TRUE)); A ; SM2A(ASM2)
#CMO documentation example
nr=5
nc=8
ra=c(3.0,5.6,1.0,2.0,1.1,1.0,-2.0,2.8,-1.0,1.0,1.0,-1.2,-1.0,1.9)
ia=c(0,4,0,1,1,2,0,3,0,4,2,3,0,4)
ja=c(0,2,4,6,8,10,11,12,14)
SMM='CMO'
ZINDEX=TRUE
ASM=list(nr=nr,nc=nc,ra=ra,ia=ia,ja=ja,SMM=SMM,ZINDEX=ZINDEX)
SM2A(ASM)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.