【发布时间】:2015-05-12 06:28:16
【问题描述】:
我有三个数据框:
df1:
id score1
1 50
2 23
3 40
4 68
5 82
6 38
df2:
id score2
1 33
2 23
4 64
5 12
6 32
df3:
id score3
1 50
2 23
3 40
4 68
5 82
我想将三个分数变成这样的数据框,使用 NA 表示缺失值
id score1 score2 score3
1 50 33 50
2 23 23 23
3 40 NA 40
4 68 64 68
5 82 12 82
6 38 32 NA
或者像这样,删除 NA 值:
id score1 score2 score3
1 50 33 50
2 23 23 23
4 68 64 68
5 82 12 82
但是,mutate(在 dplyer 中)不会采用不同的长度。所以我不能变异。我该怎么做?
【问题讨论】: