item-summary | R Documentation |
Functions for computing item summary, i.e. some summary measurements (of arbitrary nature) of item (one or more columns) present in data frame.
summarise_item(tbl, item, ..., .prefix = "") summarise_game(tbl, ..., .prefix = "") summarise_player(tbl, ..., .prefix = "") summarize_item(tbl, item, ..., .prefix = "") summarize_game(tbl, ..., .prefix = "") summarize_player(tbl, ..., .prefix = "")
tbl |
Data frame. |
item |
Character vector of columns to group by. |
... |
Name-value pairs of summary functions (as in dplyr::summarise). |
.prefix |
A string to be added to all summary functions' names. |
Basically, summarise_item()
performs the following steps:
Group tbl
by columns stored in item
. Note that starting from 0.8.0
version of dplyr
this might give a warning in case of implicit NA
s in
factor columns (NA
present in column values but not in its levels)
suggesting to add NA
to levels.
Apply dplyr's summarise()
.
Ungroup result.
Convert to tibble.
Add .prefix
to names of summary functions.
summarise_game()
and summarise_player()
are wrappers for
summarise_item()
using item = "game"
and item = "player"
respectively.
Output of summarise()
as not grouped tibble
.
Common item summary functions for competition results.
Join item summary
ncaa2005 %>% dplyr::mutate(game_type = game %% 2) %>% summarise_item(c("game_type", "player"), mean_score = mean(score)) ncaa2005 %>% summarise_game(mean_score = mean(score), min_score = min(score))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.