Reputation: 1517
I am trying to collapse the value of field Value_From
of below data set using below expression
dt [ , unique(Value_From) , by = c("From_Type","To_Type") ][ , .(val = list(c(V1)) , `Unique_From_IDs` = .N ) , by = c("From_Type","To_Type")]
However when I run this some of the values are getting dropped and I am getting below results
Please help me understand why some of the ID's are getting dropped.
Appreciate the help!
Upvotes: 0
Views: 42
Reputation: 1311
Additionally, to the comments above, try:
dt [ , unique(Value_From) , by = c("From_Type","To_Type") ][ , .(val = list(list(V1)) , `Unique_From_IDs` = .N ) , by = c("From_Type","To_Type")]
The double list()
call will make your table look like:
... ... listCol
... ... <list>
This way you won't encounter the somewhat confusing problem of abbreviation.
Upvotes: 1