Learn R Programming

BAwiR (version 1.3.4)

get_stats_seasons: Season-by-season stats

Description

This function represents the average values of a set of statistics for certain players in every season where the players played. It gives an idea of the season-by-season performance.

Usage

get_stats_seasons(df, competition, player, variabs, type_season, add_text, show_x_axis)

Value

List with two elements:

  • gg Graphical device.

  • df_gg Data frame associated with the plot.

Arguments

df

Data frame with the games and the players info.

competition

Competition.

player

Players's names.

variabs

Vector with the statistics to plot.

type_season

String with the round of competition, for example regular season or playoffs and so on.

add_text

Boolean. Should text be added to the plot points?

show_x_axis

Boolean. Should x-axis labels be shown in the plot?

Author

Guillermo Vinue

Examples

Run this code
if (FALSE) {
competition <- "ACB"
df <- do_join_games_bio("ACB", acb_games_1718, acb_players_1718)
df$Compet <- competition
player <- "Carroll, Jaycee"
variabs <- c("GP", "MP", "PTS", "EFGPerc", "TRB", "AST", "TOV", "PIR")
plot_yearly <- get_stats_seasons(df, competition, player, variabs, "All", TRUE, TRUE)
plot_yearly$gg
# There are only games from the regular season in this demo data frame.
plot_yearly1 <- get_stats_seasons(df, competition, player, variabs, "Regular Season", 
                                  TRUE, TRUE)
plot_yearly1$gg
}

Run the code above in your browser using DataLab