pv_tas_recode.Rd
Note that this function is only likely to be useful if you have scouted your VBStats files following the conventions described at https://raymondben.github.io/scouting-notes/
pv_tas_recode(x, remap = pv_tas_remap(), log_changes = FALSE) pv_tas_live_recode( x, remap = pv_tas_remap(), home_team_rotation = NULL, visiting_team_rotation = NULL, log_changes = FALSE ) pv_tas_recode_augment(x, remap = pv_tas_remap(), log_changes = FALSE) pv_tas_live_recode_augment( x, remap = pv_tas_remap(), home_team_rotation = NULL, visiting_team_rotation = NULL, log_changes = FALSE ) pv_tas_remap()
x | data.frame or tibble: a peranavolley object as returned by |
---|---|
remap | list: a list with components "conditions" and "values" that define the remapping. See |
log_changes | logical: if |
home_team_rotation | string: fixed rotation of the home team, either "SHM" or "SMH". This will be used to infer missing attack |
visiting_team_rotation | string: as for |
A modified version of x
.
This function modifies the plays component of a peranavolley object, following the scouting conventions described at https://raymondben.github.io/scouting-notes/. The following changes are made:
attacks marked as "Setter tip" ("Dump" in VBStats) by a setter are mapped to attack_code "PP"
any "Setter tip" by a non-setter are treated as freeballs. Their skill entry is changed to "Freeball", and attack code to NA
attack_code 1 to "X1"
attack_code 2 to "X2"
attack_code 3 to "X7"
attack_code 4 to "CF" (slide)
attack code 5 treated as highball, with new attack code determined by start_zone (V5, V6, etc)
any other attack (with NA attack code) treated as standard tempo with new attack code determined by start_zone (X5, X6, etc)
any dig following a freeball over is changed to skill "Freeball"
pv_tas_recode_augment
and pv_tas_live_recode_augment
are convenience functions that call pv_tas_recode
or pv_tas_live_recode
followed by pv_tas_data_augment
## Note: this is a silly example, because the example VBStats file was NOT ## scouted with the conventions expected by this function x <- pv_read(pv_example_file()) x <- pv_tas_recode(x, remap = pv_tas_remap(), log_changes = TRUE)