Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There can be multiple indices on single data.table, each index can be set on multiple fields. The most correct representation then is to return list of vectors. Current behavior:
library(data.table) dt = data.table(a=1,b=2,c=3,d=4) setindexv(dt, "a") setindexv(dt, c("a","b")) setindexv(dt, c("b","a")) setindexv(dt, c("d","c","a")) indices(dt) #[1] "a" "a__b" "b__a" "d__c__a"
Expected
list("a", c("a","b"), c("b","a"), c("d","c","a")) #[[1]] #[1] "a" # #[[2]] #[1] "a" "b" # #[[3]] #[1] "b" "a" # #[[4]] #[1] "d" "c" "a"
There could be an additional argument forcing to return a vector instead of list by collapsing column names.
sapply(list("a", c("a","b"), c("b","a"), c("d","c","a")), paste, collapse=",") #[1] "a" "a,b" "b,a" "d,c,a"
The text was updated successfully, but these errors were encountered:
indices can now return list of character vectors, closes #1589
3aa65e2
Rdatatable/data.table@fb03ad1
Minor reopen to address: 3aa65e2#commitcomment-20075531
Sorry, something went wrong.
Rdatatable/data.table@2c8b27d
jangorecki
No branches or pull requests
There can be multiple indices on single data.table, each index can be set on multiple fields.
The most correct representation then is to return list of vectors.
Current behavior:
Expected
There could be an additional argument forcing to return a vector instead of list by collapsing column names.
The text was updated successfully, but these errors were encountered: