How about
a <- which(row(matchM)!=matchM)
b <- matchM[a]
diag(collusionM[a,b]) <-1
Nikhil Kaza
Asst. Professor,
City and Regional Planning
University of North Carolina
nikhil.l...@gmail.com
On Aug 8, 2010, at 8:43 PM, david h shanabrook wrote:
It is a simple problem in that I simply want to
Try this:
Matrix(diag(duplicated(matchM)), sparse = TRUE)
On Sun, Aug 8, 2010 at 9:43 PM, david h shanabrook
wrote:
> It is a simple problem in that I simply want to convert the For loop to a
> more efficient method. It simply loops through a large vector checking if
> the numeric element is no
It is a simple problem in that I simply want to convert the For loop to a more
efficient method. It simply loops through a large vector checking if the
numeric element is not equal to the index of that element. The following
example demonstrates a simplified example:
> rows <- 10
> collusionM
3 matches
Mail list logo