Skip to contents

Retrieves a parquet file from URL. This function is cached

Usage

parquet_from_url(url)

Arguments

url

a character url

Value

a dataframe as parsed by arrow::read_parquet()

Examples

.for_cran()
# \donttest{
try({
  parquet_from_url(
    "https://github.com/nflverse/nflverse-data/releases/download/player_stats/player_stats.parquet"
  )
})
#>          player_id  player_name   player_display_name position position_group
#>      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
#>     ---                                                                      
#> 125629: 00-0039164 A.Richardson    Anthony Richardson       QB             QB
#> 125630: 00-0039165 Z.Charbonnet       Zach Charbonnet       RB             RB
#> 125631: 00-0039165 Z.Charbonnet       Zach Charbonnet       RB             RB
#> 125632: 00-0039165 Z.Charbonnet       Zach Charbonnet       RB             RB
#> 125633: 00-0039165 Z.Charbonnet       Zach Charbonnet       RB             RB
#>                                                                               headshot_url
#>      1:                                                                               <NA>
#>      2:                                                                               <NA>
#>      3:                                                                               <NA>
#>      4:                                                                               <NA>
#>      5:                                                                               <NA>
#>     ---                                                                                   
#> 125629: https://static.www.nfl.com/image/private/f_auto,q_auto/league/bqrc00wmzjbz1asoapvk
#> 125630: https://static.www.nfl.com/image/private/f_auto,q_auto/league/yuddw2o5skwkgvut6wrv
#> 125631: https://static.www.nfl.com/image/private/f_auto,q_auto/league/yuddw2o5skwkgvut6wrv
#> 125632: https://static.www.nfl.com/image/private/f_auto,q_auto/league/yuddw2o5skwkgvut6wrv
#> 125633: https://static.www.nfl.com/image/private/f_auto,q_auto/league/yuddw2o5skwkgvut6wrv
#>         recent_team season week season_type completions attempts passing_yards
#>      1:         MIA   1999    1         REG           0        0             0
#>      2:         MIA   1999    2         REG           0        0             0
#>      3:         MIA   1999    4         REG           0        0             0
#>      4:         CLE   1999    7         REG           0        0             0
#>      5:         CLE   1999    8         REG           0        0             0
#>     ---                                                                       
#> 125629:         IND   2023    5         REG           9       12            98
#> 125630:         SEA   2023    1         REG           0        0             0
#> 125631:         SEA   2023    2         REG           0        0             0
#> 125632:         SEA   2023    3         REG           0        0             0
#> 125633:         SEA   2023    4         REG           0        0             0
#>         passing_tds interceptions sacks sack_yards sack_fumbles
#>      1:           0             0     0          0            0
#>      2:           0             0     0          0            0
#>      3:           0             0     0          0            0
#>      4:           0             0     0          0            0
#>      5:           0             0     0          0            0
#>     ---                                                        
#> 125629:           0             0     1         17            1
#> 125630:           0             0     0          0            0
#> 125631:           0             0     0          0            0
#> 125632:           0             0     0          0            0
#> 125633:           0             0     0          0            0
#>         sack_fumbles_lost passing_air_yards passing_yards_after_catch
#>      1:                 0                 0                         0
#>      2:                 0                 0                         0
#>      3:                 0                 0                         0
#>      4:                 0                 0                         0
#>      5:                 0                 0                         0
#>     ---                                                              
#> 125629:                 0               125                        44
#> 125630:                 0                 0                         0
#> 125631:                 0                 0                         0
#> 125632:                 0                 0                         0
#> 125633:                 0                 0                         0
#>         passing_first_downs passing_epa passing_2pt_conversions  pacr    dakota
#>      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
#>     ---                                                                        
#> 125629:                   5    2.136096                       0 0.784 0.1350797
#> 125630:                   0          NA                       0    NA        NA
#> 125631:                   0          NA                       0    NA        NA
#> 125632:                   0          NA                       0    NA        NA
#> 125633:                   0          NA                       0    NA        NA
#>         carries rushing_yards rushing_tds rushing_fumbles rushing_fumbles_lost
#>      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
#>     ---                                                                       
#> 125629:       2             5           0               0                    0
#> 125630:       3            11           0               0                    0
#> 125631:       4            16           0               0                    0
#> 125632:       9            46           0               0                    0
#> 125633:       5            31           0               0                    0
#>         rushing_first_downs rushing_epa rushing_2pt_conversions receptions
#>      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
#>     ---                                                                   
#> 125629:                   0  -0.4766016                       0          0
#> 125630:                   0  -1.0130621                       0          0
#> 125631:                   2   0.8344912                       0          2
#> 125632:                   5   2.7355235                       0          1
#> 125633:                   1   0.6214398                       0          1
#>         targets receiving_yards receiving_tds receiving_fumbles
#>      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
#>     ---                                                        
#> 125629:       0               0             0                 0
#> 125630:       0               0             0                 0
#> 125631:       2              14             0                 0
#> 125632:       2              -1             0                 0
#> 125633:       3               9             0                 0
#>         receiving_fumbles_lost receiving_air_yards receiving_yards_after_catch
#>      1:                      0                   0                           0
#>      2:                      0                   0                           0
#>      3:                      0                   0                           0
#>      4:                      0                   0                           0
#>      5:                      0                   0                           0
#>     ---                                                                       
#> 125629:                      0                   0                           0
#> 125630:                      0                   0                           0
#> 125631:                      0                   3                          11
#> 125632:                      0                  -5                           7
#> 125633:                      0                 -14                          14
#>         receiving_first_downs receiving_epa receiving_2pt_conversions
#>      1:                     0     0.2923782                         0
#>      2:                     1     0.3770089                         0
#>      3:                     0    -0.6995777                         0
#>      4:                     0    -0.2284540                         0
#>      5:                     0            NA                         0
#>     ---                                                              
#> 125629:                     0            NA                         0
#> 125630:                     0            NA                         0
#> 125631:                     0     0.6087014                         0
#> 125632:                     0    -1.9041700                         0
#> 125633:                     0    -4.8205846                         0
#>               racr target_share air_yards_share       wopr special_teams_tds
#>      1:  0.0000000   0.05263158      0.00000000 0.00000000                 0
#>      2:  0.0000000   0.11764706      0.00000000 0.00000000                 0
#>      3:  0.0000000   0.02380952      0.00000000 0.00000000                 0
#>      4:  0.0000000   0.05000000      0.00000000 0.00000000                 0
#>      5:         NA           NA              NA         NA                 0
#>     ---                                                                     
#> 125629:         NA           NA              NA         NA                 0
#> 125630:         NA           NA              NA         NA                 0
#> 125631:  4.6666667   0.05405405      0.01345291 0.09049812                 0
#> 125632:  0.2000000   0.05714286     -0.01650165 0.07416313                 0
#> 125633: -0.6428571   0.11538462     -0.10937500 0.09651442                 0
#>         fantasy_points fantasy_points_ppr opponent_team
#>      1:          12.70              13.70          <NA>
#>      2:           5.10               8.10          <NA>
#>      3:           0.20               0.20          <NA>
#>      4:           3.50               5.50          <NA>
#>      5:           3.90               3.90          <NA>
#>     ---                                                
#> 125629:           4.42               4.42           TEN
#> 125630:           1.10               1.10            LA
#> 125631:           3.00               5.00           DET
#> 125632:           4.50               5.50           CAR
#> 125633:           4.00               5.00           NYG
# }