[datatable-help] possible sort bug?

Michael Smith my.r.help at gmail.com
Fri Jan 15 05:51:07 CET 2016


Try

dt[(id) %in% smp, ]


On 01/15/2016 10:39 AM, Huashan Chen wrote:
>
>
> dt = data.table(id=1:30, nn = paste0('A', 1:30))
> smp = sample(30, size =10)
>
> #  data is sorted as expected
> aa = dt$id %in% smp
> dt[aa, ]
>
> # However, this gives unsorted result
> dt[id %in% smp, ]
>
> Is this a bug or by design?
>
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/possible-sort-bug-tp4716440.html
> Sent from the datatable-help mailing list archive at Nabble.com.
> _______________________________________________
> datatable-help mailing list
> datatable-help at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
>


More information about the datatable-help mailing list