I'm sure this is a simple task, but how to do it has escaped me.

I have imported data from two separate files (each file contains the
results from an information retrieval algorithm) organized into a list.
They are organized by File,Query, and Rank (in that order):

[[1]]
Doc   Query   Rank
5     1       1
9     1       2
7     1       3
5     2       1
7     2       2
9     2       3

[[2]]
Doc   Query   Rank
4     1       1
5     1       2
9     1       3
8     2       1
5     2       2
7     2       3

I need to rearrange the data so that it is sorted by Query and Document,
with columns for rank1 and rank2 (from files 1 and 2, respectively). For
example:

[[1]]
Doc   Query   Rank1   Rank1
4     1       NA      1
5     1       1       2
7     1       3       NA
9     1       2       3
5     2       1       2
7     2       2       3
8     2       NA      1
9     2       3       NA

My goal is to perform a Spearman/Kendall test to check the correlation
between the rankings.

Any help would be appreciated.

Andrew Noyes

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to