Re: [R] discrepancy matrix

2010-07-16 Thread Wu Gong
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] discrepancy matrix

2010-07-16 Thread nero
Hi! I want to create a discrepancy matrix. I have got a data.frame Q: number colour date 2 343b1503 3 678 g 1701 4 347b1904 5 345b2001 6 123 g 1809 Now i want to cre