volleyR - Expected Value for Volleyball, Automatically

Barriers to entry are a real, paralyzing thing.

Especially when trying to pick up a new skill, like working with data in R.

The goal of releasing this R package is to make it SUPER SIMPLE for any performance analyst, technical coordinator, student manager, or fellow volleydork to get their data in good working order + sprinkle some Expected Value into their workflow.

*** First and foremost, I want to credit Ben Raymond and Adrien Ickowicz (Science Untangled / OpenVolley) as volleyR stands on their shoulders. They've made the lives of analysts much much easier in recent years - so it's in that same vein that hopefully this package will continue to lower the barriers to entry for analytics in our sport. ***

So here we go, it's like 9 super simple steps.

1. Download + install both R and Rstudio (https://cran.r-project.org) + (https://posit.co/downloads/)

2. Open RStudio and create a new project (Create Project > New Directory > New Project > name the directory whatever you like)

3. Type getwd() in the R console and hit enter. This will tell you the folder R is using

4. In that folder, create a new folder called dvwfiles (or whatever you want...)

5. Throw some volleymetrics DVW files into that new dvwfiles folder

(we use coordinate data today, so we need VM files - they can be cleaned - at the moment...)

Ok we're like basically almost done and your folders should look like this. In R, you can download and load packages to add functionality. So there are a couple things we need.

Copy and run the following code:

6.

install.packages(c("tidyverse", "remotes"))
library(remotes)
library(tidyverse)
remotes::install_github("openvolley/datavolley")
remotes::install_github("volleydork/volleyR")
library(datavolley)
library(volleyR)

7. my.files <- list.files(path = "./dvwfiles", pattern = "*.dvw", full.names = TRUE)

8. fancydataset <- volleyR::build_epv_average(my.files)

9. View(fancydataset)

^ translation: 

(6) we're installing + loading some packages to help us out.

(7) we create a list of dvw files that live in the dvwfiles folder.

(8) we do magic - using the function build_epv_average from the package volleyR, we take the list named my.files and run a bunch of code behind the scenes.

(9) we visualize the dataset

And that's it! Fewer than 10 steps and you've got a neat dataset with Expected Value thrown in as a cherry on top.

If you have no idea what Expected Value is, but think it sounds cool, you can read more: here

Couple ideas to get you started using this data:

(1) Expected Sideout by Reception Quality

(2) Expected Points Added (EPA) per Attack, by Team

(3) Best Blockers by EPA with at least 10 block touches

1. fancydataset %>% filter(skill == "Reception") %>% group_by(skq) %>% summarize(expected_sideout = 100*round(mean(epv_out),3), n = n()) %>% arrange(desc(expected_sideout))

2. fancydataset %>% filter(skill == "Attack") %>% group_by(team) %>% summarize(epv_added_average = round(mean(epv_added), 3), n = n()) %>% arrange(desc(epv_added_average))

3. fancydataset %>% filter(skill == "Block") %>% group_by(player_name) %>% summarize(epv_added_average = round(mean(epv_added), 3), n = n()) %>% arrange(desc(epv_added_average)) %>% filter(n > 10)