For absolute physical speed, use data.table directly. While the learning curve might be longer, the improvement of computation performance pays off if you are dealing with large datasets frequently. There are several ways to cut into data.table syntax to gain higher performance in tidyfst. A convenient way is to use the
DT[I,J,BY] syntax after the pipe(
This syntax is not so consistent with the tidy syntax, therefore
in_dt is also designed for the short cut to data.table method, which could be used as:
in_dt follows the basic principals of tidyfst, which include: (1) Never use in place replacement. Therefore, the in place functions like
:= will still return the results. (2) Always recieves a data frame (data.frame/tibble/data.table) and returns a data.table. This means you don’t have to write
as_dt all the time as long as you are working on data frames in R.