1

I have a dist class object returned by the stringdistmatrix function from the stringdist package. I want to identify the row and column of every entry in the object that is less than 10, for example. Can anyone suggest a way of doing this without converting the dist object to a matrix? Thanks.

Tom

user1930565
  • 238
  • 1
  • 6
  • `which(x <= 10, arr.ind=TRUE)` ? though if that works it may be coercing to matrix in the background. – Frank Sep 30 '16 at 18:29
  • 2
    Zheyuan, post your comment as an answer and I will accept it. Thanks! – user1930565 Sep 30 '16 at 18:35
  • 1
    Your answer is exactly what I needed. – user1930565 Sep 30 '16 at 18:39
  • @Zheyuan You might consider commenting to the OP there, who earlier left a comment saying they thought the answer might have a problem. I pinged them about accepting (assuming either of the answers actually works for them). – Frank Sep 30 '16 at 18:59

0 Answers0