【发布时间】:2012-11-15 18:39:58
【问题描述】:
假设我有这些数据,
(df <- data.frame( col1 = c('My','Your','His','Thir'), col2 = c('Cat','Dog','Fish','Dog')))
col1 col2
1 My Cat
2 Your Dog
3 His Fish
4 Thir Dog
我想像这样合并列
`some magic`
col1 col2 col3
1 My Cat My Cat
2 Your Dog Your Dog
3 His Fish His Fish
4 Thir Dog Thir Dog
我该怎么办?甚至可以像这样使用逗号(,),
`some magic`
col1 col2 col3
1 My Cat My, Cat
2 Your Dog Your, Dog
3 His Fish His, Fish
4 Thir Dog Thir, Dog
【问题讨论】:
标签: r join merge data-management