I assume that this is what you did, and I would not call that
cheating; it is just a reasonable way to solve the problem:
> x <- as.matrix(read.table(textConnection(" 0.00 2.384158 2.0065682
> 2.2998856
+ 2.384158 0.00 1.4599928 2.4333213
+ 2.006568 1.459993 0.000 0.9733285
+ 2.299886
Sorry if this is a stupid question but I've been stuck on how to code
so that I can order rows of a matrix without paying attention to the
diagonal elements.
Say, for example, I have a matrix d:
d
[,1] [,2] [,3] [,4]
[1,] 0.00 2.384158 2.0065682 2.2998856
[2,] 2.3
2 matches
Mail list logo