setDT instead of as.data.table for piping with dplyr?

247 Views Asked by At

I've noted that dtplyr (released this January 1.0.1) uses as.data.table to bring the variable back to data.table type: https://dtplyr.tidyverse.org/articles/translation.html

I'm a big fan and user of data.table and use it pipeline with dplyr for many years, for which purpose I wrote myself many of those wrapper functions, which are now part of dtplyr.

I'm however using setDT, as I thought it's more efficient as keeps with data.table mentality of assigning by reference.

So I wonder why Hadley is not using it?
And in general - what's more efficient to use of the two, when one needs to convert from data.frame (or tibble) to data.table?

0

There are 0 best solutions below