lineups_games_adder {AdvancedBasketballStats} | R Documentation |
The function allows to perform the sums of two data.frames with the same format adopted after being transformed by lineups_data_adjustment() function,
lineups_games_adder(df1, df2)
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. |
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,
Data frame with the sum of the statistics of the other two entered data.frame.
df1 <- data.frame("PG" = c("James","Rondo"),"SG" = c("Green","Caruso"), "SF" = c("Caldwell","Kuzma"), "PF" = c("Davis","Davis"), "C" = c("Howard ","Howard"),"MP" = c(7,1), "FG " = c(4,0), "FGA " = c(7,0),"Percentage FG" = c(0.571,0), "X3P " = c(0,0),"X3PA " = c(2,0),"Percentage 3P" = c(0,0), "X2P " = c(4,0), "X2PA " = c(5,0), "Percentage 2P" = c(0.8,0), "FT " = c(1,0), "FTA " = c(3,0), "Percentage FT" = c(0.333,0), "ORB " = c(2,0), "DRB " = c(5,0),"TRB " = c(7,0), "AST " = c(2,0), "STL " = c(1,0), "BLK " = c(0,0),"TOV " = c(7,2), "PF" = c(1,0), "PLUS" = c(9,0),"MINUS" = c(17,3),"P/M" = c(-8,-3)) df2 <- data.frame("PG" = c("James","Rondo"),"SG" = c("Green","Caruso"), "SF" = c("Caldwell","Kuzma"), "PF" = c("Davis","Davis"), "C" = c("Howard ","Howard"),"MP" = c(7,1), "FG " = c(4,0), "FGA " = c(7,0),"Percentage FG" = c(0.571,0), "X3P " = c(0,0),"X3PA " = c(2,0),"Percentage 3P" = c(0,0), "X2P " = c(4,0), "X2PA " = c(5,0), "Percentage 2P" = c(0.8,0), "FT " = c(1,0), "FTA " = c(3,0), "Percentage FT" = c(0.333,0), "ORB " = c(2,0), "DRB " = c(5,0),"TRB " = c(7,0), "AST " = c(2,0), "STL " = c(1,0), "BLK " = c(0,0),"TOV " = c(7,2), "PF" = c(1,0), "PLUS" = c(9,0),"MINUS" = c(17,3),"P/M" = c(-8,-3)) lineups_games_adder(df1,df2)