R中是否有一种方法可以根据需要汇总数据

时间:2019-07-04 05:32:55

标签: r path analytics

我无法按要求汇总数据

输入数据集就像

test = data.frame(
    name = c('A','A','A','A','A','B','B'),
    dt = c("2019-01-01","2019-01-01","2019-01-01","2019-02-01","2019-02-01","2019-02-01","2019-02-01"), 
    activity = c('P','Q','R','P','Q','S','T')
)

必需的输出数据集是

Output = data.frame(
    name = c('A','A','B'),
    dt = c("2019-01-01","2019-02-01","2019-01-01"), 
    activity_map = c('PQR','PQ','ST')
)

0 个答案:

没有答案