View source: R/get_four_factors_plot.R
| get_four_factors_plot | R Documentation |
Once computed the team's factors and its rankings with
do_four_factors_df, this function represents them.
get_four_factors_plot(df_rank, df_no_rank, team, language, scope = "def_off")
df_rank |
Data frame with the team's offense and defense four factors and its ranking labels. |
df_no_rank |
Data frame with the team's offense and defense four factors. |
team |
Team name. Multiple teams can be chosen. |
language |
Language labels. Current options are 'en' for English and 'es' for Spanish. |
scope |
Plot both defense and offense or just one of them. Options are "def_off", "def", "off". |
Graphical device.
Guillermo Vinue
do_four_factors_df
## Not run:
df <- do_join_games_bio("ACB", acb_games_1718, acb_players_1718)
df1 <- do_add_adv_stats(df)
team <- "Valencia"
df_four_factors <- do_four_factors_df(df1, team, NULL)
# If only one team is represented the ranking between parentheses is just one.
get_four_factors_plot(df_four_factors$df_rank, df_four_factors$df_no_rank, team, "en")
# Example with only defense:
get_four_factors_plot(df_four_factors$df_rank, df_four_factors$df_no_rank, team,
"en", "def") +
ggplot2::theme(legend.position = "none")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.