【发布时间】:2017-07-20 23:57:15
【问题描述】:
我想将我的数据转换为特定格式,但不知道如何使用 reshape()。
我的数据如下:
df<-data.frame(Cues=c("A","B","C","A","B","C"),
Targets=rep(1:3,2),
Rater=rep(1:2, each=3),
Rating=c(1,3,5,2,4,6))
我想得到它:
df2<-data.frame(Targets=rep(1:3,2),
Cues=c("A","B","C","A","B","C"),
Rater_1= c(1,2),
Rater_2=c(3,5),
Rater_3C=c(5,6))
我在论坛reshape() 上尽了最大努力,但并没有真正走得更远。你们能帮帮我吗?
提前致谢,最好的, 乔什
【问题讨论】:
-
你对
reshape做了什么尝试? -
我无法从你的输出中理解
-
我也是。请多解释一下你的输出