[R] Transform samples table to rank table

Psychi Psychi at gmx.de
Wed Feb 9 22:55:06 CET 2011


Hi,

im searching for a package or function to transform a data frame.

Initially the columns represents the ranks and the rows the test
persons, which sorts different samples by ranks. Unfortunately sometimes
one samples is not differentiable from another one, so they share one rank.

So, the original dataframe looks like the following example (notation of
the samples can change):

		1	2	3	4	5
person1		A	B	C=	=D	E
person2		B	C=	=E=	=B	D

Now for person 1 the sample C and D are not differentiable and share the
3.5 rank; for person 2 the samples C, E and B are equal with the rank 3.

I want to transform the given dataframe to use the sample names as
headers and the ranks as data.

		A	B	C	D	E
person1		1	2	3.5	3.5	5
person2		5	3	3	5	3

Are there any packages who to transform the data, especially with equal
rank samples?

Thanks,

P.



More information about the R-help mailing list