Skip to contents

Load any rds/csv/csv.gz/parquet/qs file from a remote URL

Usage

load_from_url(url, ..., seasons = TRUE, nflverse = FALSE)

Arguments

url

a vector of URLs to load into memory. If more than one URL provided, will row-bind them.

...

named arguments that will be added as attributes to the data, e.g. nflverse_type = "pbp"

seasons

a numeric vector of years that will be used to filter the dataframe's season column. If TRUE (default), does not filter.

nflverse

TRUE to add nflverse_data classing and attributes.

Value

a dataframe, possibly of type nflverse_data

Examples

# \donttest{
try({ # prevents cran errors
  urls <- c("https://github.com/nflverse/nflverse-data/releases/download/rosters/roster_2020.csv",
            "https://github.com/nflverse/nflverse-data/releases/download/rosters/roster_2021.csv")
 load_from_url(urls, nflverse = TRUE, nflverse_type = "rosters for 2020 & 2021")
})
#> ── nflverse rosters for 2020 & 2021 ────────────────────────────────────────────
#>  Data updated: 2023-05-12 22:16:24 UTC
#> # A tibble: 5,379 × 36
#>    season team  position depth_chart_position jersey_number status     full_name
#>     <int> <chr> <chr>    <chr>                        <int> <chr>      <chr>    
#>  1   2020 ARI   DB       CB                              25 R/Injured  Johnatha…
#>  2   2020 ARI   DB       CB                              21 Active     Patrick …
#>  3   2020 ARI   DB       CB                              20 PS; Vet    Prince A…
#>  4   2020 ARI   DB       CB                              20 Active     Dre Kirk…
#>  5   2020 ARI   DB       FS                              31 R/COVID-19 Chris Ba…
#>  6   2020 ARI   DB       CB                              23 R/Injured  Robert A…
#>  7   2020 ARI   DB       FS                              28 Active     Charles …
#>  8   2020 ARI   DB       CB                              27 Active     Kevin Pe…
#>  9   2020 ARI   DB       SS                              32 Active     Budda Ba…
#> 10   2020 ARI   DB       CB                              33 Active     Byron Mu…
#> # ℹ 5,369 more rows
#> # ℹ 29 more variables: first_name <chr>, last_name <chr>, birth_date <IDate>,
#> #   height <int>, weight <int>, college <chr>, gsis_id <chr>, espn_id <int>,
#> #   sportradar_id <chr>, yahoo_id <int>, rotowire_id <int>, pff_id <int>,
#> #   pfr_id <chr>, fantasy_data_id <int>, sleeper_id <int>, years_exp <int>,
#> #   headshot_url <chr>, ngs_position <chr>, week <int>, game_type <chr>,
#> #   status_description_abbr <chr>, football_name <chr>, esb_id <chr>, …
# }