I have a data frame where one column is string names (v1), and the second column is string values(v2), I would like to aggregate those entries and sum their string values.(V1 and V2 are list)
V1 and V2 are list
trp_str
V1 V2
1 a,x,v 0.07128713
2 b,x,c 0.06336634
3 c,x,v 0.04752475
4 c,x,v 0.04752475
5 d,x,v 0.06336634
6 a,x,v 0.07128713
i want to get like this
V1 V2
1 a,x,v 0.14257426
2 b,x,c 0.06336634
3 c,x,v 0.0950495
4 d,x,v 0.06336634
when i used aggregate(trp_str$V1, by=list(V2=trp_str$V2), FUN=sum) following error occured Error in aggregate.data.frame(as.data.frame(x), ...) : arguments must have same length