Skip to contents

Load .qs file from a remote connection

Usage

qs_from_url(url)

Arguments

url

a character url

Value

a dataframe as parsed by qs::qdeserialize()

Examples

# \donttest{
try({
  qs_from_url(
    "https://github.com/nflverse/nflverse-data/releases/download/player_stats/player_stats.qs"
  )
})
#>          player_id player_name   player_display_name position position_group
#>             <char>      <char>                <char>   <char>         <char>
#>      1: 00-0000003        <NA> Abdul-Karim al-Jabbar       RB             RB
#>      2: 00-0000003        <NA> Abdul-Karim al-Jabbar       RB             RB
#>      3: 00-0000003        <NA> Abdul-Karim al-Jabbar       RB             RB
#>      4: 00-0000003        <NA> Abdul-Karim al-Jabbar       RB             RB
#>      5: 00-0000003        <NA> Abdul-Karim al-Jabbar       RB             RB
#>     ---                                                                     
#> 131834: 00-0039921    T.Benson           Trey Benson       RB             RB
#> 131835: 00-0039921    T.Benson           Trey Benson       RB             RB
#> 131836: 00-0039921    T.Benson           Trey Benson       RB             RB
#> 131837: 00-0039921    T.Benson           Trey Benson       RB             RB
#> 131838: 00-0039921    T.Benson           Trey Benson       RB             RB
#>                                                                              headshot_url
#>                                                                                    <char>
#>      1:                                                                              <NA>
#>      2:                                                                              <NA>
#>      3:                                                                              <NA>
#>      4:                                                                              <NA>
#>      5:                                                                              <NA>
#>     ---                                                                                  
#> 131834: https://static.www.nfl.com/image/upload/f_auto,q_auto/league/iu0gbspz3kjdqlazvtkn
#> 131835: https://static.www.nfl.com/image/upload/f_auto,q_auto/league/iu0gbspz3kjdqlazvtkn
#> 131836: https://static.www.nfl.com/image/upload/f_auto,q_auto/league/iu0gbspz3kjdqlazvtkn
#> 131837: https://static.www.nfl.com/image/upload/f_auto,q_auto/league/iu0gbspz3kjdqlazvtkn
#> 131838: https://static.www.nfl.com/image/upload/f_auto,q_auto/league/iu0gbspz3kjdqlazvtkn
#>         recent_team season  week season_type opponent_team completions attempts
#>              <char>  <int> <int>      <char>        <char>       <int>    <int>
#>      1:         MIA   1999     1         REG           DEN           0        0
#>      2:         MIA   1999     2         REG           ARI           0        0
#>      3:         MIA   1999     4         REG           BUF           0        0
#>      4:         CLE   1999     7         REG            LA           0        0
#>      5:         CLE   1999     8         REG            NO           0        0
#>     ---                                                                        
#> 131834:         ARI   2024     4         REG           WAS           0        0
#> 131835:         ARI   2024     6         REG            GB           0        0
#> 131836:         ARI   2024     8         REG           MIA           0        0
#> 131837:         ARI   2024     9         REG           CHI           0        0
#> 131838:         ARI   2024    10         REG           NYJ           0        0
#>         passing_yards passing_tds interceptions sacks sack_yards sack_fumbles
#>                 <num>       <int>         <num> <num>      <num>        <int>
#>      1:             0           0             0     0          0            0
#>      2:             0           0             0     0          0            0
#>      3:             0           0             0     0          0            0
#>      4:             0           0             0     0          0            0
#>      5:             0           0             0     0          0            0
#>     ---                                                                      
#> 131834:             0           0             0     0          0            0
#> 131835:             0           0             0     0          0            0
#> 131836:             0           0             0     0          0            0
#> 131837:             0           0             0     0          0            0
#> 131838:             0           0             0     0          0            0
#>         sack_fumbles_lost passing_air_yards passing_yards_after_catch
#>                     <int>             <num>                     <num>
#>      1:                 0                 0                         0
#>      2:                 0                 0                         0
#>      3:                 0                 0                         0
#>      4:                 0                 0                         0
#>      5:                 0                 0                         0
#>     ---                                                              
#> 131834:                 0                 0                         0
#> 131835:                 0                 0                         0
#> 131836:                 0                 0                         0
#> 131837:                 0                 0                         0
#> 131838:                 0                 0                         0
#>         passing_first_downs passing_epa passing_2pt_conversions  pacr dakota
#>                       <num>       <num>                   <int> <num>  <num>
#>      1:                   0          NA                       0    NA     NA
#>      2:                   0          NA                       0    NA     NA
#>      3:                   0          NA                       0    NA     NA
#>      4:                   0          NA                       0    NA     NA
#>      5:                   0          NA                       0    NA     NA
#>     ---                                                                     
#> 131834:                   0          NA                       0    NA     NA
#> 131835:                   0          NA                       0    NA     NA
#> 131836:                   0          NA                       0    NA     NA
#> 131837:                   0          NA                       0    NA     NA
#> 131838:                   0          NA                       0    NA     NA
#>         carries rushing_yards rushing_tds rushing_fumbles rushing_fumbles_lost
#>           <int>         <num>       <int>           <num>                <num>
#>      1:      16            60           1               0                    0
#>      2:       9            33           0               0                    0
#>      3:       3             2           0               0                    0
#>      4:       6            27           0               0                    0
#>      5:      13            39           0               0                    0
#>     ---                                                                       
#> 131834:       9            50           0               1                    0
#> 131835:       5            26           0               0                    0
#> 131836:       1            10           0               0                    0
#> 131837:       8            37           1               0                    0
#> 131838:      10            62           0               0                    0
#>         rushing_first_downs rushing_epa rushing_2pt_conversions receptions
#>                       <num>       <num>                   <int>      <int>
#>      1:                   4   6.2487711                       0          1
#>      2:                   1  -1.4349502                       0          3
#>      3:                   0  -1.5399517                       0          0
#>      4:                   0   0.2160509                       0          2
#>      5:                   2  -2.9722589                       0          0
#>     ---                                                                   
#> 131834:                   3  -1.0338740                       0          0
#> 131835:                   1  -0.5138466                       0          0
#> 131836:                   1   0.6909850                       0          0
#> 131837:                   2   0.1689898                       0          1
#> 131838:                   3   1.5126457                       0          2
#>         targets receiving_yards receiving_tds receiving_fumbles
#>           <int>           <num>         <int>             <num>
#>      1:       1               7             0                 0
#>      2:       4              18             0                 0
#>      3:       1               0             0                 0
#>      4:       2               8             0                 0
#>      5:       0               0             0                 0
#>     ---                                                        
#> 131834:       0               0             0                 0
#> 131835:       0               0             0                 0
#> 131836:       0               0             0                 0
#> 131837:       1              18             0                 0
#> 131838:       2              25             0                 0
#>         receiving_fumbles_lost receiving_air_yards receiving_yards_after_catch
#>                          <num>               <num>                       <num>
#>      1:                      0                   0                           0
#>      2:                      0                   0                           0
#>      3:                      0                   0                           0
#>      4:                      0                   0                           0
#>      5:                      0                   0                           0
#>     ---                                                                       
#> 131834:                      0                   0                           0
#> 131835:                      0                   0                           0
#> 131836:                      0                   0                           0
#> 131837:                      0                   4                          14
#> 131838:                      0                  -8                          33
#>         receiving_first_downs receiving_epa receiving_2pt_conversions   racr
#>                         <num>         <num>                     <int>  <num>
#>      1:                     0     0.2923782                         0  0.000
#>      2:                     1     0.3770089                         0  0.000
#>      3:                     0    -0.6995777                         0     NA
#>      4:                     0    -0.2284540                         0  0.000
#>      5:                     0            NA                         0     NA
#>     ---                                                                     
#> 131834:                     0            NA                         0     NA
#> 131835:                     0            NA                         0     NA
#> 131836:                     0            NA                         0     NA
#> 131837:                     1     1.1114530                         0  4.500
#> 131838:                     2     1.9870165                         0 -3.125
#>         target_share air_yards_share       wopr special_teams_tds
#>                <num>           <num>      <num>             <num>
#>      1:   0.05263158             NaN        NaN                 0
#>      2:   0.11764706             NaN        NaN                 0
#>      3:   0.02380952             NaN        NaN                 0
#>      4:   0.05000000             NaN        NaN                 0
#>      5:           NA              NA         NA                 0
#>     ---                                                          
#> 131834:           NA              NA         NA                 0
#> 131835:           NA              NA         NA                 0
#> 131836:           NA              NA         NA                 0
#> 131837:   0.05263158      0.03100775 0.10065279                 0
#> 131838:   0.08333333     -0.07207207 0.07454955                 0
#>         fantasy_points fantasy_points_ppr
#>                  <num>              <num>
#>      1:           12.7               13.7
#>      2:            5.1                8.1
#>      3:            0.2                0.2
#>      4:            3.5                5.5
#>      5:            3.9                3.9
#>     ---                                  
#> 131834:            5.0                5.0
#> 131835:            2.6                2.6
#> 131836:            1.0                1.0
#> 131837:           11.5               12.5
#> 131838:            8.7               10.7
# }