i have such a data:
V1   V2   V3  V4
a    b    c   e
a    f    d   NA
b    d    e   f
h    d    NA  NA
a    d    f   e
……
(V1,V2,V3,V4 can be any one of a, b, c, d, e, f, g, h. that is to say ,it has 8 
possible values.)

and i want to change it the the following form:
a    b    c    d    e    f    g    h
8    7    6    2.5   5   2.5  2.5  2.5    #2.5is the mean of (4+3+2+1)
8    3    3     6    3    7   3    3      #3 is the mean of (5+4+3+2+1)
2.5  8    2.5   7    6    5   2.5   2.5    #2.5is the mean of (4+3+2+1)
3.5 3.5   3.5   7    3.5  3.5  3.5   8               #3.5is the mean of (6+54+3+2+1)
8   2.5   2.5   7    5    6   2.5    2.5
……

i want to know if there is some easy way to achieve my goal using R?

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

Reply via email to