Is the second result by design? I found it confusing:

x<-data.table(a=c(1:5,1:5),b=1:10)
sum(duplicated(x)) # 0, as expected
setkey(x,a)
sum(duplicated(x)) # 5

Thanks,

Joe


Joseph G. Voelkel, Ph.D.
Graduate Program Chair, Center for Quality and Applied Statistics
Kate Gleason College of Engineering
Rochester Institute of Technology
V 585-475-2231
F 585-475-5959
[email protected]

CONFIDENTIALITY NOTE: The information transmitted, including attachments, is 
intended only for the person(s) or entity to which it is addressed and may 
contain confidential and/or privileged material. Any review, retransmission, 
dissemination or other use of, or taking of any action in reliance upon this 
information by persons or entities other than the intended recipient is 
prohibited. If you received this in error, please contact the sender and 
destroy any copies of this information.

_______________________________________________
datatable-help mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help

Reply via email to