Hi everyone!
I have to following question: I have three items that had
to be ordered (e.g. three persons were rating var1 on the
first rank):
var1 var2 var3
1 2 3
2 1 3
1 3 2
1 2 3
Now I'd like to have the data.frame "the other way round", so that
the ranks are in the columns:
rank1 rank2 rank3
var1 var2 var3
var2 var1 var3
var1 var3 var2
var1 var2 var3
Can anyone help me achieving this?
# code:
var1<-c(1,2,1,1)
var2<-c(2,1,3,2)
var3<-c(3,3,2,3)
df<-as.data.frame(cbind(var1,var2,var3,var4))
??
Thank you very much!
David
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.