Skip to contents

Every team name, abbreviation and provider id the index resolves, one row per alias: what sdv_resolve() reads. The counterpart of cfbplotR's team_name_mapping (see the examples). The R counterpart of sdvplot's alias table.

Usage

sdv_aliases(league = NULL)

Arguments

league

A league key from sdv_leagues(), or NULL for every league.

Value

A data frame:

col_nametypedescription
leaguecharacterLeague key
id_systemcharacterThe id system of value ("name", "espn", "cfbd", ...; see sdv_resolve()). "mark", "conference" and "competition" rows serve the logo helpers only
valuecharacterThe alias as the index stores it (lookups ignore case and accents)
team_idcharacterThe sdv_teams() team_id it names
valid_fromintegerFirst season the alias names this team (NA: always)
valid_tointegerLast season the alias names this team (NA: still)

Examples

a <- sdv_aliases("cfb")
head(a[a$id_system == "name", ])
#>      league id_system                      value team_id valid_from valid_to
#> 4972    cfb      name              AR-Pine Bluff    2029         NA       NA
#> 4973    cfb      name                  ARK STATE    2032         NA       NA
#> 4974    cfb      name          Abilene Christian    2000         NA       NA
#> 4975    cfb      name Abilene Christian Wildcats    2000         NA       NA
#> 4976    cfb      name             Abilene Chrstn    2000         NA       NA
#> 4977    cfb      name                   Adams St    2001         NA       NA

# cfbplotR's team_name_mapping: each name -> its school
nm <- a[a$id_system %in% c("name", "cfbd", "sdvplotr"), ]
t <- sdv_teams("cfb")
mapping <- stats::setNames(t$location[match(nm$team_id, t$team_id)], nm$value)
head(mapping)
#>                AAMU                ABSU                 ACU                 ADR 
#>       "Alabama A&M"      "Albany State" "Abilene Christian"            "Adrian" 
#>                ADSU                  AF 
#>       "Adams State"         "Air Force"