例如,我有这样的data.table
library(data.table)
test <- data.table(x=c(rep(c(1:3),3)),y=c("A","B","A","C","C","B","B","B","A"))
我设置了两个键,x和y setkey(test,x,y)
;
然后我想选择&#34; x&#34; == 1或2和&#34; y&#34; ==&#34; A&#34;或&#34; B&#34;;
但如果我输入test[list(c(1,2),c("A","B"))]
我错了enter image description here
我怎样才能得到我想要的东西,谢谢!!!