R融化子类别

时间:2016-04-15 10:28:43

标签: r reshape2 melt

我试图用子类别融合表格(csv)但由于某种原因无法通过melt.array获得所需的结果

我有:

Region,Sender,Afghanistan,,,,
,,Adult,,Minor,,
,,Male ,Female,Male,Female,
EEA,Austria,165,8,6,10,
....

需要:

Reg Send    Rec         Age   Gender  Value
EEA Austria Afghanistan Adult Male    165
EEA Austria Afghanistan Adult Female  8
EEA Austria Afghanistan Adult Male    6
EEA Austria Afghanistan Adult Female  10
....

并且非常感谢一些帮助!

1 个答案:

答案 0 :(得分:0)

因为结构没有非常优雅的方式,但是zoo :: na.locf可能就是你要找的东西

.textContent