Description Usage Arguments Value See Also
View source: R/data_clean_functions.R
data_clean_tot
converts a match-wise Sackmann point-by-point dataset
into a game-wise dataaset with point-by-point records, the outcome of the
game, and accumulation scores set-wise and match-wise.
1 | data_clean_tot(us_open, last_rownum, first_rownum = 1)
|
us_open |
A Sackmann point-by-point dataset. |
last_rownum |
The last row to apply the cleaning procedure. |
first_rownum: |
The first row to apply the cleaning procedure. All rows
from |
A dataframe whose rows are the games of tennis matches with the following columns:
pbp_id
: identification corresponding to that in the original dataset
match_num
: counter of the matches cleaned
set_num
: identifies the set in which the game is played
game_num
: counter of the games in each set (resets to 1 after a new set)
pbp
: point-by-point record of the game
server
: points won by the server of the game
returner
: points won by the returner of the game
winner
: winner of the game i.e. server or returner
player1_serve
: 1 if player1 is server, 0 otherwise
player1_game
: 1 if player1 wins game, 0 otherwise
player2_game
: 1 if player2 wins game, 0 otherwise
player1_game_acc_set
: running total of number of games won by player1 in a given set
player2_game_acc_set
: running total of number of games won by player2 in a given set
player1_game_acc_total
: running total of number of games won by player1 in a given match
player2_game_acc_total
: running total of number of games won by player2 in a given match
total_game_acc
: running total of number of games in a given match
leading_set
: denotes which player has won more games in a given set
player1_set_acc
: number of sets player1 wins
player2_set_acc
: number of sets player2 wins
Other sackmann data cleaning functions: score_sets
,
split_games_by_sets
,
split_sets
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.