Skip to contents

Load .rds file from a remote connection

Usage

rds_from_url(url)

Arguments

url

a character url

Value

a dataframe as created by readRDS()

Examples

# \donttest{
try({ # prevents cran errors
  rds_from_url("https://github.com/nflverse/nfldata/raw/master/data/games.rds")
})
#>               game_id season game_type week    gameday weekday gametime
#>    1: 1999_01_MIN_ATL   1999       REG    1 1999-09-12  Sunday     <NA>
#>    2:  1999_01_KC_CHI   1999       REG    1 1999-09-12  Sunday     <NA>
#>    3: 1999_01_PIT_CLE   1999       REG    1 1999-09-12  Sunday     <NA>
#>    4:  1999_01_OAK_GB   1999       REG    1 1999-09-12  Sunday     <NA>
#>    5: 1999_01_BUF_IND   1999       REG    1 1999-09-12  Sunday     <NA>
#>   ---                                                                  
#> 6405: 2022_18_NYG_PHI   2022       REG   18 2023-01-08  Sunday    13:00
#> 6406: 2022_18_CLE_PIT   2022       REG   18 2023-01-08  Sunday    13:00
#> 6407:  2022_18_LA_SEA   2022       REG   18 2023-01-08  Sunday    13:00
#> 6408:  2022_18_ARI_SF   2022       REG   18 2023-01-08  Sunday    13:00
#> 6409: 2022_18_DAL_WAS   2022       REG   18 2023-01-08  Sunday    13:00
#>       away_team away_score home_team home_score location result total overtime
#>    1:       MIN         17       ATL         14     Home     -3    31        0
#>    2:        KC         17       CHI         20     Home      3    37        0
#>    3:       PIT         43       CLE          0     Home    -43    43        0
#>    4:       OAK         24        GB         28     Home      4    52        0
#>    5:       BUF         14       IND         31     Home     17    45        0
#>   ---                                                                         
#> 6405:       NYG         NA       PHI         NA     Home     NA    NA       NA
#> 6406:       CLE         NA       PIT         NA     Home     NA    NA       NA
#> 6407:        LA         NA       SEA         NA     Home     NA    NA       NA
#> 6408:       ARI         NA        SF         NA     Home     NA    NA       NA
#> 6409:       DAL         NA       WAS         NA     Home     NA    NA       NA
#>       old_game_id gsis nfl_detail_id          pfr pff      espn away_rest
#>    1:  1999091210  598          <NA> 199909120atl  NA 190912001         7
#>    2:  1999091206  597          <NA> 199909120chi  NA 190912003         7
#>    3:  1999091213  604          <NA> 199909120cle  NA 190912005         7
#>    4:  1999091208  602          <NA> 199909120gnb  NA 190912009         7
#>    5:  1999091202  591          <NA> 199909120clt  NA 190912011         7
#>   ---                                                                    
#> 6405:  2023010809   NA          <NA> 202301080phi  NA      <NA>         7
#> 6406:  2023010810   NA          <NA> 202301080pit  NA      <NA>         7
#> 6407:  2023010814   NA          <NA> 202301080sea  NA      <NA>         7
#> 6408:  2023010815   NA          <NA> 202301080sfo  NA      <NA>         7
#> 6409:  2023010811   NA          <NA> 202301080was  NA      <NA>        10
#>       home_rest away_moneyline home_moneyline spread_line away_spread_odds
#>    1:         7             NA             NA        -4.0               NA
#>    2:         7             NA             NA        -3.0               NA
#>    3:         7             NA             NA        -6.0               NA
#>    4:         7             NA             NA         9.0               NA
#>    5:         7             NA             NA        -3.0               NA
#>   ---                                                                     
#> 6405:         7            185           -225         5.0             -110
#> 6406:         7             NA             NA          NA               NA
#> 6407:         7           -250            200        -5.5             -110
#> 6408:         7            135           -155         3.0              100
#> 6409:         7           -120            100        -1.0             -110
#>       home_spread_odds total_line under_odds over_odds div_game     roof
#>    1:               NA       49.0         NA        NA        0     dome
#>    2:               NA       38.0         NA        NA        0 outdoors
#>    3:               NA       37.0         NA        NA        1 outdoors
#>    4:               NA       43.0         NA        NA        0 outdoors
#>    5:               NA       45.5         NA        NA        1     dome
#>   ---                                                                   
#> 6405:             -110         NA         NA        NA        1 outdoors
#> 6406:               NA         NA         NA        NA        1 outdoors
#> 6407:             -110         NA         NA        NA        1 outdoors
#> 6408:             -120         NA         NA        NA        1 outdoors
#> 6409:             -110         NA         NA        NA        1 outdoors
#>         surface temp wind away_qb_id home_qb_id       away_qb_name
#>    1: astroturf   NA   NA 00-0003761 00-0002876 Randall Cunningham
#>    2:     grass   80   12 00-0006300 00-0010560        Elvis Grbac
#>    3:     grass   78   12 00-0015700 00-0004230    Kordell Stewart
#>    4:     grass   67   10 00-0005741 00-0005106        Rich Gannon
#>    5: astroturf   NA   NA 00-0005363 00-0010346        Doug Flutie
#>   ---                                                             
#> 6405:     grass   NA   NA       <NA>       <NA>               <NA>
#> 6406:     grass   NA   NA       <NA>       <NA>               <NA>
#> 6407: fieldturf   NA   NA       <NA>       <NA>               <NA>
#> 6408:     grass   NA   NA       <NA>       <NA>               <NA>
#> 6409:     grass   NA   NA       <NA>       <NA>               <NA>
#>         home_qb_name         away_coach    home_coach       referee stadium_id
#>    1: Chris Chandler       Dennis Green    Dan Reeves  Gerry Austin      ATL00
#>    2: Shane Matthews Gunther Cunningham   Dick Jauron  Phil Luckett      CHI98
#>    3:      Ty Detmer        Bill Cowher  Chris Palmer   Bob McElwee      CLE00
#>    4:    Brett Favre         Jon Gruden    Ray Rhodes Tony Corrente      GNB00
#>    5: Peyton Manning      Wade Phillips      Jim Mora      Ron Blum      IND99
#>   ---                                                                         
#> 6405:           <NA>       Brian Daboll Nick Sirianni          <NA>      PHI00
#> 6406:           <NA>    Kevin Stefanski   Mike Tomlin          <NA>      PIT00
#> 6407:           <NA>         Sean McVay  Pete Carroll          <NA>      SEA00
#> 6408:           <NA>    Kliff Kingsbury Kyle Shanahan          <NA>      SFO01
#> 6409:           <NA>      Mike McCarthy    Ron Rivera          <NA>      WAS00
#>                        stadium
#>    1:             Georgia Dome
#>    2:            Soldier Field
#>    3: Cleveland Browns Stadium
#>    4:            Lambeau Field
#>    5:                 RCA Dome
#>   ---                         
#> 6405:  Lincoln Financial Field
#> 6406:              Heinz Field
#> 6407:              Lumen Field
#> 6408:           Levi's Stadium
#> 6409:               FedExField
# }