in_dt | R Documentation |
To use facilities provided by data.table, but do not have to load data.table package.
in_dt(.data, ...)
as_dt(.data)
.data |
A data.frame |
... |
Recieve |
The as_dt
could turn any data frame to data.table class. If the data is
not a data frame, return error.
The in_dt
function creates a virtual environment in data.table, it could be
piped well because it still follows the principals of tidyfst, which are: (1) Never
use in place replacement and (2) Always recieves a data frame (data.frame/tibble/data.table)
and returns a data.table. Therefore, the in place functions like :=
will still
return the results.
data.table
iris %>% as_dt()
iris %>% in_dt(order(-Sepal.Length),.SD[.N],by=Species)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.