AdvancedBasketballStats
AdvancedBasketballStats
R topics documented:
individuals_advance_stats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
individuals_data_adjustment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
individuals_defensive_actual_floor_stats . . . . . . . . . . . . . . . . . . . . . . . . . . 6
individuals_defensive_estimated_floor_stats . . . . . . . . . . . . . . . . . . . . . . . . 8
individuals_games_adder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
individuals_ofensive_floor_stats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
individuals_stats_per_game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1
2 individuals_advance_stats
individuals_stats_per_minutes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
individuals_stats_per_possesion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
lineups_advance_stats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
lineups_backcourt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
lineups_comparator_stats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
lineups_data_adjustment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
lineups_games_adder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
lineups_paint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
lineups_players . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
lineups_searcher . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
lineups_separator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
lineups_stats_per_possesion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
play_advance_stats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
play_data_adjustment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
play_games_adder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
play_stats_per_game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
play_stats_per_possesion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
play_team_stats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
team_advanced_stats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
team_stats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
team_stats_per_game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
team_stats_per_minutes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
team_stats_per_possesion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Index 43
individuals_advance_stats
Individual advanced statistics
Description
This function allows the calculation of advanced individual statistics.
Usage
individuals_advance_stats(df1, df2, df3)
Arguments
df1 Should be a Data Frame that represents the individual statistics or individual de-
fensive statistics of the players. The parameter has to be in the format provided
by the data_adjustment() function.
df2 Should be a Data Frame that represents the team’s statistics. The parameter has
to be in the format provided by the team_stats() function.
df3 Should be a Data Frame that represents the rival’s statistics. The parameter has
to be in the format provided by the team_stats() function.
individuals_advance_stats 3
Value
Data frame with the following advanced statistics calculated:
Author(s)
Fco Javier Cantero <fco.cantero@edu.uah.es>
Juan José Cuadrado <jjcg@uah.es>
Universidad de Alcalá de Henares
Examples
individuals_advance_stats(df1,df2,df3)
individuals_data_adjustment
Individual stat adjuster
Description
The function transform the statistics entered for later use in the rest of the functions that apply to
individuals statistics.
Usage
individuals_data_adjustment(df1)
Arguments
df1 Should be a Data Frame that represents the individual statistics of the players.
The parameter has to be in the format provided by the data_adjustment() func-
tion.
Details
• The data.frame must have the same columns and these represent the same as in the example.
• The input data.frame must have the last row that represents the team’s statistics.
• The function allows the transformation of the individual’s statistics to which the shooting
percentages and the number of total rebounds are added.
• The function allows the transformation of the defensive statistics to which the force missed
shot and the forced turnovers.
Value
Data.frame with the transformed statistics for use in the rest of the functions.
The data frame obtained for the individual’s statistics will have the following format:
The data frame obtained for the defensive individual’s statistics will have the following format:
Author(s)
Fco Javier Cantero <fco.cantero@edu.uah.es>
Juan José Cuadrado <jjcg@uah.es>
Universidad de Alcalá de Henares
Examples
df1 <- data.frame("Name" = c("James","Team"), "G" = c(67,0), "GS" = c(62,0),
"MP" = c(2316,1), "FG" = c(643,0), "FGA" = c(1303,0),"3P " = c(148,0),
"3PA" = c(425,0),"2P" = c(495,0), "2PA" = c(878,0), "FT" = c(264,0),
"FTA" = c(381,0),"ORB" = c(66,0), "DRB" = c(459,0), "AST" = c(684,0),
"STL" = c(78,0), "BLK" = c(36,0),"TOV" = c(261,0), "PF" = c(118,0),
"PTS" = c(1698,0), "+/-" = c(0,0))
individuals_data_adjustment(df1)
individuals_data_adjustment(df2)
individuals_defensive_actual_floor_stats
Individual’s defensive actual statistics
Description
The function allows the calculation of individual defensive actual statistics on court
Usage
individuals_defensive_actual_floor_stats(df1, df2, df3)
Arguments
df1 Should be a Data Frame that represents the individual defensive statistics of the
players. The parameter has to be in the format provided by the data_adjustment()
function.
df2 Should be a Data Frame that represents the team’s statistics. The parameter has
to be in the format provided by the team_stats() function.
df3 Should be a Data Frame that represents the rival’s statistics. The parameter has
to be in the format provided by the team_stats() function.
individuals_defensive_actual_floor_stats 7
Value
Author(s)
Examples
individuals_defensive_actual_floor_stats(df1,df2,df3)
8 individuals_defensive_estimated_floor_stats
individuals_defensive_estimated_floor_stats
individual’s defensive estimated statistics
Description
The function allows the calculation of individual defensive estimated statistics on court
Usage
individuals_defensive_estimated_floor_stats(df1, df2, df3)
Arguments
df1 Should be a Data Frame. The parameter has to be in the format provided by the
data_adjustment() function.
df2 Should be a Data Frame. The parameter has to be in the format provided by the
team_stats() function.
df3 Should be a Data Frame. The parameter has to be in the format provided by the
team_stats() function.
Value
Data frame with the following individual defensive estimated statistics
Author(s)
Fco Javier Cantero <fco.cantero@edu.uah.es>
Juan José Cuadrado <jjcg@uah.es>
Universidad de Alcalá de Henares
Examples
individuals_defensive_estimated_floor_stats(df1,df2,df3)
individuals_games_adder
individual’s games adder
Description
The function allows to perform the sums of two data.frames with the same format adopted after
being transformed by individuals_data_adjustment() function,
Usage
individuals_games_adder(df1, df2)
Arguments
df1 Should be a Data Frame that represents the first set of individual statistics or
defensive individual statistics of the players. It has to be in the format provided
by the individuals_data_adjustment() function
df2 Should be a Data Frame that represents the second set of individual statistics or
defensive individual statistics of the players. It has to be in the format provided
by the individuals_data_adjustment() function
Details
The function will work correctly when the name of the players is the same, in case it is different it
will take the players as different.
10 individuals_ofensive_floor_stats
Value
Data frame with the sum of the statistics of the other two entered data.frame.
Examples
individuals_games_adder(df1,df2)
individuals_ofensive_floor_stats
individual’s offensive floor stats
Description
The function allows the calculation of individual’s offensive statistics on court
Usage
individuals_ofensive_floor_stats(df1, df2, df3)
Arguments
df1 Should be a Data Frame that represents the individual statistics of the players.
The parameter has to be in the format provided by the data_adjustment() func-
tion.
df2 Should be a Data Frame that represents the team’s statistics. The parameter has
to be in the format provided by the team_stats() function.
df3 Should be a Data Frame that represents the rival’s statistics. The parameter has
to be in the format provided by the team_stats() function.
individuals_ofensive_floor_stats 11
Value
Data frame with the following individual’s offensive statistics
Author(s)
Fco Javier Cantero <fco.cantero@edu.uah.es>
Juan José Cuadrado <jjcg@uah.es>
Universidad de Alcalá de Henares
Examples
individuals_ofensive_floor_stats(df1,df2,df3)
12 individuals_stats_per_game
individuals_stats_per_game
individual’s statistics per game
Description
The function allows the calculation of individual statistics per game.
Usage
individuals_stats_per_game(df1)
Arguments
df1 Should be a Data Frame that represents the individual statistics of the players.
The parameter has to be in the format provided by the data_adjustment() func-
tion.
Details
The calculation is made with the number of games played by the player.
Value
Data frame with individual statistics per game
Author(s)
Fco Javier Cantero <fco.cantero@edu.uah.es>
Juan José Cuadrado <jjcg@uah.es>
Universidad de Alcalá de Henares
Examples
individuals_stats_per_game(df1)
individuals_stats_per_minutes 13
individuals_stats_per_minutes
individual statistics calculator per minutes
Description
The function allows the calculation of the statistics per game projected to M minutes.
Usage
individuals_stats_per_minutes(df1, m)
Arguments
df1 Should be a Data Frame that represents the individual statistics of the players.
The parameter has to be in the format provided by the data_adjustment() func-
tion.
m Should be a number. This parameter has to be the number of minutes to which
you want to project the statistics.
Details
The statistical projection is made from the relationship between the number of minutes entered and
the number of minutes played by the player.
Value
Data frame with statistics by game projected to the minutes entered.
Author(s)
Fco Javier Cantero <fco.cantero@edu.uah.es>
Juan José Cuadrado <jjcg@uah.es>
Universidad de Alcalá de Henares
Examples
m <- 48
individuals_stats_per_minutes(df1,m)
individuals_stats_per_possesion
individual statistics calculator per possessions
Description
The function allows the calculation of the statistics per game projected to P possesions.
Usage
individuals_stats_per_possesion(df1, df2, df3, p, m)
Arguments
df1 Should be a Data Frame that represents the individual statistics of the players.
The parameter has to be in the format provided by the data_adjustment() func-
tion.
df2 Should be a Data Frame that represents the team’s statistics. The parameter has
to be in the format provided by the team_stats() function.
df3 Should be a Data Frame that represents the rival’s statistics. The parameter has
to be in the format provided by the team_stats() function.
p Should be a number. This parameter has to be the number of possessions to
which you want to project the statistics.
m should be a number. This parameter has to be the duration of a single game.
Details
The statistical projection is made from the estimation of the possessions that the team plays when
the player is on the court.
Value
Data frame with statistics by game projected to the possessions entered
Author(s)
Fco Javier Cantero <fco.cantero@edu.uah.es>
Juan José Cuadrado <jjcg@uah.es>
Universidad de Alcalá de Henares
lineups_advance_stats 15
Examples
p <- 100
m <- 48
individuals_stats_per_possesion(df1,df2,df3,p,m)
Description
Usage
lineups_advance_stats(df1, m)
16 lineups_advance_stats
Arguments
df1 Should be a Data Frame. This parameter has to be in the format provided by the
lineups_advance_stats() function.
m should be a number. This parameter has to be the duration of a single game.
Details
The function only works with the extended statistics of the lineups.
Value
Data frame with the following advanced statistics calculated
• Offensive Rating (ORtg)
• Defensive Rating (DRtg)
• Net Rating (NetRtg)
• Pace (Pace)
• Three rating (3Par)
• True shooting percentage (TS%)
• Efficiency Field Goals percentage (eFG%)
• Assists percentage (AST%)
• Offensive rebounds percentage (ORB%)
• Defensive rebounds percentage (DRB%)
• Total rebounds percentage (TRB%)
• Turnover percentage (TOV%)
Examples
m <- 48
lineups_advance_stats(df1,m)
lineups_backcourt 17
Description
The function allows find the statisticts of backcourt players
Usage
lineups_backcourt(df1)
Arguments
df1 Should be a Data Frame. The parameter has to be in the format provided by the
lineups_data_adjustment() function.
Details
The function works with the basic statistics of the lineups and the extended statistics of the lineups.
Value
Data frame with the statistics of the backcourt players
Author(s)
Fco Javier Cantero <fco.cantero@edu.uah.es>
Juan José Cuadrado <jjcg@uah.es>
Universidad de Alcalá de Henares
Examples
lineups_backcourt(df1)
lineups_backcourt(df1)
lineups_comparator_stats
Lineups statistics comparator
Description
The function allows the comparison of a lineup when it is in the court with the statistics of the rival
Usage
lineups_comparator_stats(df1, m)
Arguments
df1 Should be a Data Frame. The parameter has to be in the format provided by the
lineups_data_adjustment() function.
m should be a number. This parameter has to be the duration of a single game.
Details
The function only works with the extended statistics of the lineups.
Value
Data frame with the comparison of statistics and the following values:
Author(s)
Examples
m <- 48
lineups_comparator_stats(df1,m)
lineups_data_adjustment
Lineups data adjustment
Description
The function transform the statistics entered for later use in the rest of the functions that apply to
lineup statistics.
Usage
lineups_data_adjustment(df1)
Arguments
Details
• The data.frame must have the same columns and these represent the same as in the example.
• The function allows the transformation of the basic statistics of the lineups to which the shoot-
ing percentages, the total rebounds and the plus minus.
• The function allows the transformation of the extended statistics of the lineups to which the
total rebounds and the plus minus.
Value
The data frame obtained for the basic statistics of lineups will have the following format:
• Point Guard (PG)
• Shooting Guard (SG)
• Small Forward (SF)
• Paint Forward (PF)
• Center (C)
• Games played (G)
• Games Started (GS)
• Minutes Played (MP)
• Field Goals Made (FG)
• Field Goals Attempted (FGA)
• Field Goals Percentage (FG
• Three Points Made (3P)
• Three Points Attempted (3PA)
• Three Points Percentage (3P%)
• Two Points Made (2P)
• Two Points Attempted (2PA)
• Free Throw Made (FT)
• Offensive Rebounds (ORB)
• Defensive Rebounds (DRB)
• Total Rebounds (TRB)
• Assists (AST)
• Steals (STL)
• Blocks (BLK)
• Turnover (TOV)
• Personal Fouls (PF)
• Points (PTS)
• Plus (+)
• Minus (-)
• Plus Minus (+/-)
For the extended statistics of the lineups it will have the same format as the basic statistics of the
lineups but adding the statistics of the opponent against that lineups.
lineups_games_adder 21
Author(s)
Fco Javier Cantero <fco.cantero@edu.uah.es>
Juan José Cuadrado <jjcg@uah.es>
Universidad de Alcalá de Henares
Examples
lineups_data_adjustment(df1)
lineups_data_adjustment(df1)
Description
The function allows to perform the sums of two data.frames with the same format adopted after
being transformed by lineups_data_adjustment() function,
Usage
lineups_games_adder(df1, df2)
22 lineups_games_adder
Arguments
df1 Should be a Data Frame that represents the first set of basic or extener lineups
statistics. It has to be in the format provided by the lineups_data_adjustment()
function.
df2 Should be a Data Frame that represents the second set of basic or extener lineups
statistics. It has to be in the format provided by the lineups_data_adjustment()
function.
Details
• The function will work correctly when the name of the players is the same, in case it is different
it will take the lineups as different.
• The function sums data sets that have an identical size,
Value
Data frame with the sum of the statistics of the other two entered data.frame.
Examples
lineups_games_adder(df1,df2)
lineups_paint 23
Description
The function allows find the statisticts of paint players
Usage
lineups_paint(df1)
Arguments
df1 Should be a Data Frame. The parameter has to be in the format provided by the
lineups_data_adjustment() function.
Details
The function works with the basic statistics of the lineups and the extended statistics of the lineups.
Value
Data frame with the statistics of the paint players
Author(s)
Fco Javier Cantero <fco.cantero@edu.uah.es>
Juan José Cuadrado <jjcg@uah.es>
Universidad de Alcalá de Henares
Examples
lineups_paint(df1)
lineups_paint(df1)
Description
The function allows you to search for statistics by position within the lineup.
Usage
lineups_players(df1, n)
Arguments
df1 Should be a Data Frame. The parameter has to be in the format provided by the
lineups_data_adjustment() function.
n Should be a number. It represents the position on which you want to perform
the search.
Details
The function allows you to search for paint players both in basic statistics and in extended statistics.
The supported values for n are as follows:
• If the value entered for n is 1, it will return the statistics of the grouped Point Guards.
• If the value entered for n is 2, it will return the statistics of the grouped Small Guards.
• If the value entered for n is 3, it will return the statistics of the grouped Small Forwards.
• If the value entered for n is 4, it will return the statistics of the grouped Paint Forwards.
• If the value entered for n is 5, it will return the statistics of the grouped Centers.
Value
Data frame with the statistics by position.
lineups_searcher 25
Author(s)
Fco Javier Cantero <fco.cantero@edu.uah.es>
Juan José Cuadrado <jjcg@uah.es>
Universidad de Alcalá de Henares
Examples
n <- 1
lineups_players(df1,n)
n <- 5
lineups_players(df1,n)
Description
The function allows the statistical search of the lineups where the entered players appear.
26 lineups_searcher
Usage
lineups_searcher(df1, n, p1, p2, p3, p4)
Arguments
df1 Should be a Data Frame. This parameter has to be in the format provided by the
lineups_advance_stats() function.
n Should be a numer. It represents the number of player to be found.
p1 Should be a String. Represents the name of the first player to be found.
p2 Should be a String. Represents the name of the second player to be found.
p3 Should be a String. Represents the name of a player to be found.
p4 Should be a String. Represents the name of a player to be found.
Details
• The function allows you to search for paint players both in basic statistics and in extended
statistics.
• The values allowed by n are 1, 2, 3 and 4.The number entered in N must be equal to the
number of players searched.
• The name entered in the function must be the same as the one inside the data frame.
Value
Data frame with the statistics of the lineups where the entered players appear
Author(s)
Fco Javier Cantero <fco.cantero@edu.uah.es>
Juan José Cuadrado <jjcg@uah.es>
Universidad de Alcalá de Henares
Examples
n <- 2
lineups_separator 27
p1 <- "James"
p2 <- "Davis"
p3 <- ""
p4 <- ""
lineups_searcher(df1,n,p1,p2,p3,p4)
Description
The function allows to separate the extended statistics of the lineups. Therefore, you can obtain the
statistics of the lineups or the rival with respect to the lineups for later analysis
Usage
lineups_separator(df1, n)
Arguments
df1 Should be a Data Frame. The parameter has to be in the format provided by the
lineups_data_adjustment() function.
n Should be a number. it Represents the statistics we want to obtain.
Details
The function only works with the extended statistics of the lineups. The supported values for n are
as follows:
• If n takes the value of 1, the function will return the statistics of the lineup.
• If n takes the value of 2, the function will return the statistics of the rival with respect to the
lineup.
Value
Data frame with the statistics separated in the format of the basic statistics of the lineups.
Author(s)
Fco Javier Cantero <fco.cantero@edu.uah.es>
Juan José Cuadrado <jjcg@uah.es>
Universidad de Alcalá de Henare
28 lineups_stats_per_possesion
Examples
n <- 1
lineups_separator(df1,n)
n <- 2
lineups_separator(df1,n)
lineups_stats_per_possesion
Lineups stats per possesion
Description
The function do the calculation of statistics per p possesion for the differents lineups
Usage
lineups_stats_per_possesion(df1, df2, df3, p, m)
Arguments
df1 Should be a Data Frame. This parameter has to be in the format provided by the
lineups_advance_stats() function.
df2 Should be a Data Frame that represents the team’s statistics. The parameter has
to be in the format provided by the team_stats() function.
df3 Should be a Data Frame that represents the rival’s statistics. The parameter has
to be in the format provided by the team_stats() function.
p Should be a number. This parameter has to be the number of possessions to
which you want to project the statistics.
m should be a number. This parameter has to be the duration of a single game.
lineups_stats_per_possesion 29
Details
• The function only works with the basic statistics of the lineups.
• The statistical projection is made from the estimation of the possessions that the team plays
when the lineups is on the court.
Value
Data frame whit statistics per p possesion
Author(s)
Fco Javier Cantero <fco.cantero@edu.uah.es>
Juan José Cuadrado <jjcg@uah.es>
Universidad de Alcalá de Henares
Examples
p <- 100
m <- 48
30 play_advance_stats
lineups_stats_per_possesion(df1,df2,df3,p,m)
Description
Usage
play_advance_stats(df1)
Arguments
df1 Should be a Data Frame that represents the play’s statistics. The parameter has
to be in the format provided by the play_data_adjustment() function.
Value
Author(s)
Examples
play_advance_stats(df1)
Description
The function transform the statistics entered for later use in the rest of the functions that apply to
play statistics.
Usage
play_data_adjustment(df1)
Arguments
df1 Should be a Data Frame that represents the play’s statistics. The parameter has
to be in the format provided by the play_data_adjustment() function.
Details
• The data.frame must have the same columns and these represent the same as in the example.
• The input data.frame must have the last row that represents the team’s statistics.
• The function allows the transformation of the play statistics to which the shooting percentages.
Value
The data frame obtained for the play statistics will have the following format:
Author(s)
Fco Javier Cantero <fco.cantero@edu.uah.es>
Juan José Cuadrado <jjcg@uah.es>
Universidad de Alcalá de Henares
Examples
play_data_adjustment(df1)
Description
The function allows to perform the sums of two data.frames with the same format adopted after
being transformed by play_data_adjustment() function,
Usage
play_games_adder(df1, df2)
play_stats_per_game 33
Arguments
df1 Should be a Data Frame that represents the first set of play’s statistics. It has to
be in the format provided by the play_data_adjustment() function.
df2 Should be a Data Frame that represents the second set of play’s statistics. It has
to be in the format provided by the play_data_adjustment() function.
Details
The function will work correctly when the name of the players is the same, in case it is different it
will take the players as different.
Value
Data frame with the sum of the statistics of the other two entered data frame.
Examples
play_games_adder(df1,df2)
Description
The function allows the calculation of play statistics per game.
Usage
play_stats_per_game(df1)
34 play_stats_per_possesion
Arguments
df1 Should be a Data Frame that represents the play’s statistics. The parameter has
to be in the format provided by the play_data_adjustment() function.
Details
The calculation is made with the number of games played by the player.
Value
Author(s)
Examples
play_stats_per_game(df1)
play_stats_per_possesion
Play stats per possesion
Description
The function allows the calculation of the statistics per game projected to P possesions.
Usage
Arguments
df1 Should be a Data Frame that represents the play’s statistics. The parameter has
to be in the format provided by the play_data_adjustment() function.
df2 Should be a Data Frame that represents the team’s statistics. The parameter has
to be in the format provided by the team_stats() function.
df3 Should be a Data Frame that represents the rival’s statistics. The parameter has
to be in the format provided by the team_stats() function.
p Should be a number. This parameter has to be the number of possessions to
which you want to project the statistics.
m should be a number. This parameter has to be the duration of a single game.
Details
The statistical projection is made from the estimation of the possessions that the team plays when
the player is on the court.
Value
Data frame with statistics by game projected to the possesions entered
Author(s)
Fco Javier Cantero <fco.cantero@edu.uah.es>
Juan José Cuadrado <jjcg@uah.es>
Universidad de Alcalá de Henares
Examples
p<- 100
m <- 48
play_stats_per_possesion(df1,df2,df3,p,m)
Description
The function performs the sum of the statistical sections to obtain a data.frame with the total statis-
tics of the team.
Usage
play_team_stats(df1)
Arguments
df1 Should be a Data Frame that represents the play’s statistics. This parameter has
to be in the format provided by the play_data_adjustment() function.
Value
Data frame whit the team’s plays statistics
Author(s)
Fco Javier Cantero <fco.cantero@edu.uah.es>
Juan José Cuadrado <jjcg@uah.es>
Universidad de Alcalá de Henares
Examples
"TOV" = c(27,1))
play_team_stats(df1)
Description
This function allows the calculation of advanced team’s statistics.
Usage
team_advanced_stats(df1, df2, m)
Arguments
df1 Should be a Data Frame that represents the team statistics. This parameter has
to be in the format provided by the team_stats() function.
df2 Should be a Data Frame that represents the rival statistics. This parameter has
to be in the format provided by the team_stats() function.
m should be a number. This parameter has to be the duration of a single game.
Value
Data frame with the following advanced statistics calculated:
• Offensive Rating (ORtg)
• Defensive Rating (DRtg)
• Net Rating (NetRtg)
• Pace (Pace)
• Three rating (3Par)
• True shooting percentage (TS%)
• Efficiency Field Goals percentage (eFG%)
• Assists percentage (AST%)
• Assist to Turnover Ratio (AST/TO)
• Assist Ratio (ASTRATIO)
• Offensive rebounds percentage (ORB%)
• Defensive rebounds percentage (DRB%)
• Total rebounds percentage (TRB%)
• Turnover percentage (TOV%)
• Free Throw rating (FTr)
38 team_stats
Examples
df1 <- data.frame("G" = c(71), "MP" = c(17090), "FG" = c(3006),
"FGA" = c(6269),"Percentage FG" = c(0.48), "3P" = c(782),
"3PA" = c(2242), "Percentage 3P" = c(0.349), "2P" = c(2224),
"2PA" = c(4027), "Percentage 2P" = c(0.552), "FT" = c(1260),
"FTA FG" = c(1728), "Percentage FT" = c(0.729), "ORB" = c(757),
"DRB" = c(2490),"TRB" = c(3247),"AST" = c(1803),"STL" = c(612),
"BLK" = c(468), "TOV" = c(1077), "PF" = c(1471),
"PTS" = c(8054), "+/-" = c(0))
m <- 48
team_advanced_stats(df1,df2,m)
Description
This function allows the team statistics from individual statistics.
Usage
team_stats(df1)
Arguments
df1 Should be a Data Frame that represents the individual statistics or individual de-
fensive statistics of the players. The parameter has to be in the format provided
by the data_adjustment() function.
team_stats_per_game 39
Details
The function performs the sum of the statistical sections to obtain a data.frame with the total statis-
tics of the team.
Value
Data frame with the sum of the team’s statistics.
Author(s)
Fco Javier Cantero <fco.cantero@edu.uah.es>
Juan José Cuadrado <jjcg@uah.es>
Universidad de Alcalá de Henares
Examples
team_stats(df1)
Description
The function allows the calculation of team’s statistics per game.
Usage
team_stats_per_game(df1)
Arguments
df1 Should be a Data Frame that represents the team statistics. This parameter has
to be in the format provided by the team_stats() function.
Details
The calculation is made with the number of games played by the team.
40 team_stats_per_minutes
Value
Data frame whit the team’s statistics per game
Author(s)
Fco Javier Cantero <fco.cantero@edu.uah.es>
Juan José Cuadrado <jjcg@uah.es>
Universidad de Alcalá de Henares
Examples
team_stats_per_game(df1)
team_stats_per_minutes
Team stats per minutes
Description
The function allows the calculation of the team statistics per game projected to M minutes.
Usage
team_stats_per_minutes(df1, m)
Arguments
df1 Should be a Data Frame that represents the team statistics. This parameter has
to be in the format provided by the team_stats() function.
m Should be a number. This parameter has to be the number of minutes to which
you want to project the statistics.
Details
The statistical projection is made from the relationship between the number of minutes entered and
the number of minutes played by the team
team_stats_per_possesion 41
Value
Data frame with statistics by game projected to the minutes entered.
Author(s)
Fco Javier Cantero <fco.cantero@edu.uah.es>
Juan José Cuadrado <jjcg@uah.es>
Universidad de Alcalá de Henares
Examples
m <- 48
team_stats_per_minutes(df1,m)
team_stats_per_possesion
Team stats per possesion
Description
The function allows the calculation of the statistics per game projected to P possesions.
Usage
team_stats_per_possesion(df1, df2, p)
Arguments
df1 Should be a Data Frame that represents the team statistics. This parameter has
to be in the format provided by the team_stats() function.
df2 Should be a Data Frame that represents the rival statistics. This parameter has
to be in the format provided by the team_stats() function.
p Should be a number. This parameter has to be the number of possessions to
which you want to project the statistics.
42 team_stats_per_possesion
Details
The statistical projection is made from the estimation of the possessions that the team plays.
Value
Data frame with statistics by game projected to the possessions entered.
Author(s)
Fco Javier Cantero <fco.cantero@edu.uah.es>
Juan José Cuadrado <jjcg@uah.es>
Universidad de Alcalá de Henares
Examples
p <- 100
team_stats_per_possesion(df1,df2,p)
Index
individuals_advance_stats, 2
individuals_data_adjustment, 4
individuals_defensive_actual_floor_stats,
6
individuals_defensive_estimated_floor_stats,
8
individuals_games_adder, 9
individuals_ofensive_floor_stats, 10
individuals_stats_per_game, 12
individuals_stats_per_minutes, 13
individuals_stats_per_possesion, 14
lineups_advance_stats, 15
lineups_backcourt, 17
lineups_comparator_stats, 18
lineups_data_adjustment, 19
lineups_games_adder, 21
lineups_paint, 23
lineups_players, 24
lineups_searcher, 25
lineups_separator, 27
lineups_stats_per_possesion, 28
play_advance_stats, 30
play_data_adjustment, 31
play_games_adder, 32
play_stats_per_game, 33
play_stats_per_possesion, 34
play_team_stats, 36
team_advanced_stats, 37
team_stats, 38
team_stats_per_game, 39
team_stats_per_minutes, 40
team_stats_per_possesion, 41
43