Description Usage Arguments Value See Also Examples
Analogous function for summarise and summarise_all in dplyr.
1 2 3 4 5 6 7 | summarise_dt(data, ..., by, keyby, fun = NULL)
summarize_dt(data, ..., by, keyby, fun = NULL)
summarise_all_dt(data, fun, by, keyby)
summarize_all_dt(data, fun, by, keyby)
|
data |
data.frame |
... |
List of variables or name-value pairs of summary/modifications functions. |
by |
unquoted name of grouping variable of list of unquoted names of grouping variables. For details see data.table |
keyby |
Same as |
fun |
function which will be applied to all variables in
|
data.table
summarise,dt_summarise,
summarise_all,dt_summarise_all
1 2 3 4 5 6 7 8 | iris %>% summarise_dt(avg = mean(Sepal.Length))
iris %>% summarise_dt(avg = mean(Sepal.Length),by = Species)
mtcars %>% summarise_dt(avg = mean(hp),by = .(cyl,vs))
# the data.table way
mtcars %>% summarise_dt(cyl_n = .N, by = .(cyl, vs)) # `.`` is short for list
iris %>%summarise_all_dt(fun = mean,by = Species)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.