Displaying 1 result from an estimated 1 matches for "cog2cat".
Did you mean:
codecat
2010 Oct 23
1
Summarizing For Values with Multiple categories
...C COG3 30
D COG4 40
I would like to sum all the counts for each category:
A B C D
10 30 40 60
>CAT2COG<-
list(A="COG1",B=c("COG1","COG2"),C=c("COG1","COG3"),D=c("COG2","COG4"))
> COG2CAT<-
list(COG1=c("A","B","C"),COG2=c("B","D"),COG3=c("C"),COG4="D")
> df<-
data.frame(COGs=c("COG1","COG2","COG3","COG4"),counts=c(10,20,30,40))
I've been trying various vers...