-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
68 lines (49 loc) · 3.7 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%",
message = FALSE
)
```
[![Travis-CI Build Status](https://travis-ci.org/openvolley/peranavolley.svg?branch=master)](https://travis-ci.org/openvolley/peranavolley)
[![lifecycle](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://www.tidyverse.org/lifecycle/#stable)
![openvolley](https://img.shields.io/badge/openvolley-darkblue.svg?logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMTAiIGhlaWdodD0iMjEwIj48cGF0aCBkPSJNOTcuODMzIDE4Ny45OTdjLTQuNTUtLjM5Ni0xMi44MTItMS44ODYtMTMuNTgxLTIuNDQ5LS4yNDItLjE3Ny0xLjY5Mi0uNzUzLTMuMjIyLTEuMjgxLTI4LjY5Ni05Ljg5NS0zNS4xNy00NS45ODctMTMuODY4LTc3LjMyMyAyLjY3Mi0zLjkzIDIuNTc5LTQuMTktMS4zOTQtMy45MDYtMTIuNjQxLjktMjcuMiA2Ljk1Mi0zMy4wNjYgMTMuNzQ1LTUuOTg0IDYuOTI3LTcuMzI3IDE0LjUwNy00LjA1MiAyMi44NjIuNzE2IDEuODI2LS45MTgtLjE3LTEuODktMi4zMS03LjM1Mi0xNi4xNzQtOS4xODEtMzguNTYtNC4zMzctNTMuMDc0LjY5MS0yLjA3IDEuNDE1LTMuODY2IDEuNjEtMy45ODkuMTk0LS4xMjM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9IjEwNC40NDEiIHJ4PSI5NC44NCIgcnk9IjkyLjU0MiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjEwLjc0Ii8+PC9zdmc+)
# peranavolley
An R package for reading [Perana Sports VBStats](http://peranasports.com/software/vbstatshd/) volleyball scouting files as well as [Perana Sports VideoTagger](http://peranasports.com/software/videotagger/) files.
See also [datavolley](https://github.com/openvolley/datavolley), which provides similar functionality for reading DataVolley files into R. The conventions (data structures, variable naming, etc) used in the peranavolley package follow those of the datavolley package.
## Installation
```{r eval = FALSE}
options(repos = c(openvolley = "https://openvolley.r-universe.dev",
CRAN = "https://cloud.r-project.org"))
install.packages("peranavolley")
## or
## install.packages("remotes") ## if needed
remotes::install_github("openvolley/peranavolley")
```
## Example
Read one of the example data files bundled with the package:
```{r}
library(peranavolley)
x <- pv_read(pv_example_file())
summary(x)
```
Number of serves by team:
```{r}
serve_idx <- which(plays(x)$skill == "Serve")
table(plays(x)$team[serve_idx])
```
Attack kill rate by player, using `dplyr`:
```{r}
library(dplyr)
plays(x) %>% dplyr::filter(skill == "Attack") %>%
group_by(team, player_name, player_id) %>%
dplyr::summarize(`N attacks` = n(), `Kill rate` = mean(evaluation == "Winning attack", na.rm = TRUE)) %>%
ungroup %>%
dplyr::arrange(desc(`Kill rate`)) %>% dplyr::select(-player_id)
```