ongoal

Data for several Pittsburgh Penguins seasons on whether a shots was on goal or not.

OTHER License

Stars
3

output: github_document

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

ongoal

library(ongoal)

ongoal makes r nrow(on_goal) data points available for Pittsburgh Penguins games where the it was determined whether a shot was on goal (i.e., made it to the goaltender) or not (i.e., missed or blocked). Data are from seasons 2015-2016, 2016-2017, and 2017-2018.

Several other columns were recorded related to the game, player, and shot. The data are not perfect; the determination of power play duration were manually calculated and may not be completely accurate.

Installation

You can install the development version of ongoal:

require(pak)
pak::pak("topepo/ongoal")

Example

Here's a look at the data:

library(ongoal)
str(on_goal)

There's also a visualization function (based on Bill Tran's function):

suppressPackageStartupMessages(library(dplyr))
set.seed(12)
on_goal %>% 
    filter(abs(angle) < 10 & distance < 80) %>% 
    plot_nhl_shots(emphasis = on_goal, alpha = 1 / 2)

Code of Conduct

Please note that the ongoal project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.