我有一个看起来像这样的数据框:
data.frame(name=c("a","a","b","b","c"),
value=c("2011-01-23","2011-01-23","2011-01-23","2011-01-22","2011-01-22"))
name value
a 2011-01-23
a 2011-01-23
b 2011-01-23
b 2011-01-22
c 2011-01-22
我只有 3 个不同的名字,我想把它变成:
a b c date
2 1 0 2011-01-23
0 1 1 2011-01-22
我查看了 reshape 包,但我无法很好地理解文档来解决这个问题。