I need to return the class of a specific id for a table. Often a single id encodes several classes:
id<-c("A","B","C","D","C","B","A")
clas<-c(1,2,2,2,3,3,4)
tab<-data.frame(id,clas)
What I need is to make a data.frame that returns as follows:
id clas
1 1 A
2 2 BCD
3 3 CB
4 4 A
Someone can help me