Learn R Programming

BAwiR (version 1.3.4)

do_stats_teams: Accumulated and average statistics for teams

Description

This function computes the total and average statistics for every team.

Usage

do_stats_teams(df_games, season, competition, type_season)

Value

A list with two elements:

  • df_team_total: Data frame with the total statistics for every team.

  • df_team_mean: Data frame with the average statistics for every team.

Arguments

df_games

Data frame with the games, players info, advanced stats and eventually recoded teams names.

season

String indicating the season, for example, 2017-2018.

competition

String. Options are "ACB", "Euroleague" and "Eurocup".

type_season

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

Author

Guillermo Vinue

Examples

Run this code
compet <- "ACB"
df <- do_join_games_bio(compet, acb_games_1718, acb_players_1718)
df$Compet <- compet
df_teams <- do_stats_teams(df, "2017-2018", "ACB", "Regular Season")
# Total statistics:
#df_teams$df_team_total
# Average statistics:
#df_teams$df_team_mean

Run the code above in your browser using DataLab