Read Perana Sports volleyball data file

pv_read(
  filename,
  insert_technical_timeouts = FALSE,
  do_warn = FALSE,
  extra_validation = 2,
  raw_only = FALSE,
  eventgrades = pv_default_eventgrades(),
  errortypes = pv_default_errortypes(),
  subevents = pv_default_subevents(),
  setting_zones,
  postprocess = NULL
)

Arguments

filename

string: path to file

insert_technical_timeouts

logical: if TRUE, insert technical timeouts at 8 and 16 points

do_warn

logical: should we issue warnings about the contents of the file as we read it?

extra_validation

numeric: should we run some extra validation checks on the file? 0=no extra validation, 1=check only for major errors, 2=somewhat more extensive, 3=the most extra checking

raw_only

logical: if TRUE, just decompress the file, don't parse it

eventgrades

tibble: a tibble that defines the interpretations of eventgrade values; see pv_default_eventgrades

errortypes

tibble: a tibble that defines the interpretations of errortype values; see pv_default_errortypes

subevents

tibble: a tibble that defines the interpretations of subevent values; see pv_default_subevents

setting_zones

named character: if the data file has been scouted using setting zones, then each attack will have its associated setting zone (numbered 1 to 5). The setting zone names are not stored in the file, so they can be provided here as a character vector. This can either be an un-named character vector, in which case it must be of length 5; otherwise if only a subset of the five setting zones are being used then it can be provided as a named character vector(e.g. setting_zones = c("1" = "X1", "3" = "X7", "4" = "medium/fast", "5" = "high")). The values in this vector will be used to populate the attack_code column of the returned plays data

postprocess

string or function: function, or name of function, to apply to the peranavolley object as the final step in the processing

Value

A named list with several elements. raw contains the extracted but unparsed text from the psvb file, meta provides match metadata, plays the play-by-play data in the form of a data.frame, and messages is a data.frame describing any inconsistencies found in the file.

References

http://peranasports.com/

See also

Examples

filename <- pv_example_file() x <- pv_read(filename) x <- pv_read(filename, setting_zones = c("X1", "X2", "X7", "medium/fast", "high"))