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()

Arguments

x

data.frame or tibble: a peranavolley object as returned by pv_read, or the plays component thereof

remap

list: a list with components "conditions" and "values" that define the remapping. See pv_tas_remap for an example

log_changes

logical: if TRUE, the returned object will have a "changes" attribute describing the changes that were made

home_team_rotation

string: fixed rotation of the home team, either "SHM" or "SMH". This will be used to infer missing attack start_zone values (assuming the standard attack by role - e.g. the default attack for an opposite is X6 when they are front row (except in P1 reception when it is X5), and X8 when they are back row). If home_team_rotation is NULL this will not be done

visiting_team_rotation

string: as for home_team_rotation, but for the visiting team

Value

A modified version of x.

Details

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

Examples

## 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)