util_map_player_id {nhlapi}R Documentation

Retrieve a player id from the name

Description

Using a table of hashed names and ids, get a player id based on the name.

Usage

util_map_player_id(x, map = getOption("nhlapi_player_map"))

Arguments

x

character(1) a player's name, not case sensitive for convenience.

map

data.frame, with 2 columns:

  • nameMd5: character() of hashed player names

  • id: integer() of player ids used by the NHL API

Value

integer(1), id of the player or NA_integer if not found.

Examples

  nhlapi:::util_map_player_id(
   "Joe Sakic",
   data.frame(
     nameMd5 = "9d2a915c8610dbc524c1bc800e010fcc",
     id = 19L,
     stringsAsFactors = FALSE
   )
 )

[Package nhlapi version 0.1.4 Index]