-
Couldn't load subscription status.
- Fork 1k
Closed
Description
Please check the below code output:
ids <- c(10, 10, 10, 11, 12, 12)
items <- c('soup', 'rice', 'lemon', 'chicken', 'lamb', 'noodles')
orders <- as.data.table(list(id=ids, item=items))
orders[,list(list(item)), by=id]
On R 3.1.1 it is producing the below (incorrect) output:
id V1
1: 10 lamb,noodles,lemon
2: 11 lamb,noodles,lemon
3: 12 lamb,noodles,lemon
where as it should be as below:
id V1
1: 10 soup,rice,lemon
2: 11 chicken
3: 12 lamb,noodles
I remember this working correctly in earlier R versions, after upgrading to latest 3.1.1 started encountering this problem. (Or, if it is my mistake and I am doing something wrong, please correct me, Thanks).