我的数据框是这样的:
> mydata
time id product
1 201301 1 apple
2 201302 1 htc
3 201302 1 apple
4 201302 2 htc
5 201302 2 apple
如何得到以下结果?
> result
time id product
1 201301 1 apple
2 201302 1 apple&htc
3 201302 2 apple&htc
我试过ddply()
这样的功能:
ddply(mydata,.(time,id),summarise,paste0(product,"&",product))
但这并不符合我的预期。感谢您的回答。
而且,我的观点是,如何在 SAP HANA DATABASE 中的 SQL 中实现?非常感谢!