[R] comparing row by row in matrix
Petra Steiner
steinep at unimuenster.de
Tue Mar 26 20:07:50 CET 2002
Hello,
and thanks for the two responses to my questions on binary matrixes, which
showed me that the functions I needed do not exist.
To get a distance matrix with the RussellRaocoefficient, I first have to
compare each row of a binary matrix with each row and count how many
elements are
a. equal
and
b. 1.
by
f < function(x,y) (sum(x == 1& y == x))
Now how can I iterate this over a matrix without a loop? I think apply etc.
will not work in this case.
Thanks for any help.
Regards,
Petra


Petra Steiner
Arbeitsbereich Linguistik
Universitaet Muenster
Huefferstrasse 27
48149 Muenster
Tel: 0251 / 83 39442
petra at marley.unimuenster.de
http://santana.unimuenster.de/~petra/
.......................................
rhelp mailing list  Read http://www.ci.tuwien.ac.at/~hornik/R/RFAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: rhelprequest at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the Rhelp
mailing list