dt <- data.table(x = 1:10, y = 1:5) dt_dlply(dt, .(y), ~.[which.max(x)]) dt_ddply(dt, .(y), ~ top_n(., 1, x))
Add the following code to your website.
REMOVE THIS Copy to clipboard
For more information on customizing the embed code, read Embedding Snippets.