Le 15/08/10 02:43, david h shanabrook a écrit :
I need to increment cells of a matrix (collusionM). The indexes to increment
are in an index (matchIndex). This is sample code
library(seqinr)
library(Matrix)
x<- "abcabcabc"
mx<- s2c(x)
collisionM<- Matrix(0,nrow=10, ncol=1
I need to increment cells of a matrix (collusionM). The indexes to increment
are in an index (matchIndex). This is sample code
library(seqinr)
library(Matrix)
x <- "abcabcabc"
mx <- s2c(x)
collisionM <- Matrix(0,nrow=10, ncol=10, sparse=TRUE)
matchIndex <- list()
rows <-
I need to increment cells of a matrix (collusionM). The indexes to increment
are in an index (matchIndex). This is some of the code
for (j in 1:(rows-1)) matchIndex[[j]] <- which(mx[j]==mx)
for (j in 1:(rows-1)) collisionM[j,matchIndex[[j]]] <-
collisionM[j,matchIndex[[j]]] + 1
3 matches
Mail list logo