dv2sc: Create a SportsCode XML file from a DataVolley volleyball...

Description Usage Arguments Value See Also Examples

View source: R/dv2sc.R

Description

Create a SportsCode XML file from a DataVolley volleyball match file

Usage

1
2
3
dv2sc(x, destfile = tempfile(fileext = ".xml"), home_team_short,
  visiting_team_short, rotation_style = "international",
  preprocess = "sc_preprocess")

Arguments

x

datavolley or data.frame: a datavolley object as returned by datavolley::read_dv(), or the plays component of that object

destfile

string: destination file name. If NULL, the function will return the raw XML rather than the filename

home_team_short

string: the short name to use for the home team. If missing or NULL, the home_team_id from x will be used

visiting_team_short

string: the short name to use for the visiting team. If missing or NULL, the visiting_team_id from x will be used

rotation_style

string: "international" or "USA". Using the USA style, rotation 1 is when the setter is in position 1 and rotation 2 is when they are in position 6. Using the international style, rotation 1 is when the setter is in position 1 and rotation 2 is when they are in position 2.

preprocess

string or function: the name of a function, or the function itself, that should be applied to the x prior to creating the Sportscode file. The preprocess function should take a single argument x and return a modified copy of that object

Value

The path to the created XML file, or if destfile was NULL, the XML itself as a character vector.

See Also

datavolley::read_dv()

Examples

1
2
x <- read_dv(dv_example_file())
sx <- dv2sc(x)

scienceuntangled/dvsc documentation built on Jan. 2, 2020, 12:54 a.m.