我有以下data.table(data6):
> head (data6)
sequenceID transactionID eventID
1: 36652675 2862 1
2: 38763251 68 1
3: 39535156 113964 1
4: 39535156 113965 2
5: 39535156 113966 3
6: 39535156 113967 4
items
1: 34D89F927092290A5DA9B108F7020C19 SELECT
2: 15873DB37BF80750C70B68A8778B9DC01D548B6D06E3BF92CADAFF289B3FCAEE CALL
3: 005C9FFB9292EDFF0356C4326B14CA06 SELECT
4: 9AD4E96D7EF2FC7B64407EAF4E2274868B2C0545BFBA9F15F828D9986D484A4D CALL
5: 828F0D137BDA57F7F4F02801B0E51FDEDCB610BC734FE31D26399E5CBCE651FF SELECT;5BD81A7A48EDA2B8E56100CE844D3BE7 SELECT
6: 828F0D137BDA57F7F4F02801B0E51FDEDCB610BC734FE31D26399E5CBCE651FF SELECT;5BD81A7A48EDA2B8E56100CE844D3BE7 SELECT
我使用以下命令:
data6<-setDT(data6)[,if(any(eventID>2)) .SD , sequenceID][,names(data),with=FALSE]
我得到了结果:
> data6
Null data.table (0 rows and 0 cols)
为什么?
答案 0 :(得分:1)
感谢@akrun, 我涉及名称(数据)而不是名称(data6)。 更正后的命令:
data6<-setDT(data6)[,if(any(eventID>2)) .SD , sequenceID][,names(data6),with=FALSE]