Skip to content

Commit 80b6448

Browse files
20251203 - use nfl4th data on OSF if errors out upon load
1 parent ddf72f7 commit 80b6448

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

download-football-data.qmd

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1345,12 +1345,28 @@ Note: the following code takes a while to run.
13451345
:::
13461346

13471347
```{r}
1348-
#| output: false
1348+
#| eval: false
13491349
13501350
nfl_4thdown_raw <- nfl4th::load_4th_pbp(
13511351
seasons = 2014:nflreadr::most_recent_season())
13521352
```
13531353

1354+
```{r}
1355+
#| include: false
1356+
1357+
tryCatch(
1358+
{
1359+
nfl_4thdown_raw <- nfl4th::load_4th_pbp(
1360+
seasons = 2014:nflreadr::most_recent_season()
1361+
)
1362+
},
1363+
error = function(e) { # if errors out when trying to load the data using nfl4th::load_4th_pbp()
1364+
message("Primary load failed; falling back to OSF version...")
1365+
petersenlab::robust_load("https://osf.io/download/nhcrj/")
1366+
}
1367+
)
1368+
```
1369+
13541370
```{r}
13551371
save(
13561372
nfl_4thdown_raw,

0 commit comments

Comments
 (0)