Re: [R] extracting diagonal from dist()

2008-10-02 Thread Tony
Stephen, I think this is what you want: > diag(as.matrix(d)[-1, ]) the '-1' above means that you ignore row one in the matrix. Given that it's a square matrix, I suppose you could also also do: > diag(as.matrix(d)[-1,-19]) the '-19' above mean you ignore the 19th column of hte matrix. Both give

[R] extracting diagonal from dist()

2008-10-01 Thread stephen sefick
h <- structure(list(V1 = c(-0.351714766, 0.188298251, 0.042951816, -0.072490327, -0.691885485, -0.816169763, -0.7066502, -0.856286332, -0.839723411, -0.427242353, -0.372911996, 0.326707494, 0.07847893, 0.687447841, 0.516105863, 0.267076547, 0.727867663, 0.432699191, 0.258610632), V2 = c(0.256636068