[R] discrepancy matrix

Wu Gong wg2f at mtmail.mtsu.edu
Fri Jul 16 18:01:58 CEST 2010


I guess your data frame is a little different from the reference, so your
as.logical doesn't work.

attach(Q)

FUN <- function(X, Y) {abs(X - Y)}

round(outer(rank(date)[colour=="b"],rank(date)[colour=="g"],FUN) +
outer(rank(number)[colour=="b"],rank(number)[colour=="g"],FUN))

detach(Q) 

-----
A R learner.
-- 
View this message in context: http://r.789695.n4.nabble.com/discrepancy-matrix-tp2291126p2291585.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list