Learn R Programming

nhlscrape (version 0.1.3)

GetHeatmapCoords: Get the heatmap coordinates for certain events in the database

Description

This function will take in a team_id and a list of game_ids, and a list of events to looks for, and resturn a list of x, y coordinates, transformed to be attacking zone on the left of the rink, and defending zone on the right of the rink. Some anomalies due to how the NHL tracks positions

Usage

GetHeatmapCoords(team_id, gids, events_list)

Arguments

team_id

Int, id of the team to transfrom for

gids

Int, list of game ids to check for events

events_list

Character, string of events to select from the database Note that events must be quoted in single quotes inside the string

Value

List, containing all x, y pairs for events and additional metadata

Examples

Run this code
# NOT RUN {
SetDbPath(example = TRUE)
GetHeatmapCoords(10, 2019020001, "'Shot', 'Goal'")

# }

Run the code above in your browser using DataLab