Skip to contents

This function allows you to scrape a team's active payroll from Spotrac.

Usage

sptrc_team_active_payroll(team_abbr, year = most_recent_mlb_season())

Arguments

team_abbr

Team abbreviation

year

Year to load

Value

A data frame of contract data.

col_nametypes
yearnumeric
teamcharacter
player_namecharacter
roster_statuscharacter
agenumeric
posnumeric
statusnumeric
waiver_optionsnumeric
base_salarynumeric
signing_bonusnumeric
payroll_salarynumeric
adj_salarynumeric
payroll_percentnumeric
lux_tax_salarynumeric
total_salarynumeric

Examples

# \donttest{
 try(sptrc_team_active_payroll(team_abbr = "BAL", year = most_recent_mlb_season()))
#> ── MLB Active Payroll data from Spotrac.com ───────── baseballr 1.6.0 ──
#>  Data updated: 2024-04-13 21:57:24 UTC
#> # A tibble: 32 × 15
#>     year team  player_name       roster_status   age pos   status    
#>    <dbl> <chr> <chr>             <chr>         <dbl> <chr> <chr>     
#>  1  2024 BAL   Corbin Burnes     Active           29 SP    Arb 3     
#>  2  2024 BAL   Craig Kimbrel     Active           36 RP/CL Vet       
#>  3  2024 BAL   Anthony Santander Active           29 RF    Arb 4 (S2)
#>  4  2024 BAL   Cedric Mullins    Active           29 CF    Arb 2     
#>  5  2024 BAL   Austin Hays       Active           28 LF    Arb 2     
#>  6  2024 BAL   Ryan Mountcastle  Active           27 DH    Arb 1     
#>  7  2024 BAL   James McCann      Active           34 C     Vet       
#>  8  2024 BAL   Ryan O'Hearn      Active           30 1B    Arb 3     
#>  9  2024 BAL   Jorge Mateo       Active           29 SS    Arb 2     
#> 10  2024 BAL   Daniel Coulombe   Active           34 RP    Arb 3     
#> # ℹ 22 more rows
#> # ℹ 8 more variables: waiver_options <dbl>, base_salary <dbl>,
#> #   signing_bonus <dbl>, payroll_salary <dbl>, adj_salary <dbl>,
#> #   payroll_percent <dbl>, lux_tax_salary <dbl>, total_salary <dbl>
# }