Create a vector of unique values out of several columns with overlapping values
问题 In my data.frame I have three columns on the SUBJECT of a row. I want an additional column with a unique subject for each row. First, how my data looks like: DATE <- c("1","2","3","4","5","6","7","1","2","3","4","5","6","7") COMP <- c("A", "A", "A", "A", "A", "A", "A", "B", "B", "B", "B", "B", "B", "B") RET <- c(-2.0,1.1,3,1.4,-0.2, 0.6, 0.1, -0.21, -1.2, 0.9, 0.3, -0.1,0.3,-0.12) CLASS <- c("positive", "negative", "aneutral", "positive", "positive", "negative", "aneutral", "positive",