util_map_player_ids {nhlapi}R Documentation

Retrieve a player ids from their names

Description

Retrieve a player ids from their names

Usage

util_map_player_ids(playerNames, map = getOption("nhlapi_player_map"))

Arguments

playerNames

character(), vector of one or more player names. 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(), named vector of player ids, 'NA_integer“ for those names where id was not found. In case a player name has multiple ids, all of them are returned.

Examples

  nhlapi:::util_map_player_ids(
    c("Joe SAKIC", "peter Forsberg", "test")
  )

[Package nhlapi version 0.1.4 Index]