update_db updates or creates a SQLite database with nflfastR play by play data of all completed games since 1999.

update_db(
  dbdir = ".",
  dbname = "pbp_db",
  tblname = "nflfastR_pbp",
  force_rebuild = FALSE,
  db_connection = NULL
)

Arguments

dbdir

Directory in which the database is or shall be located

dbname

File name of an existing or desired SQLite database within dbdir

tblname

The name of the play by play data table within the database

force_rebuild

Logical parameter to rebuild the play by play data table within the database from scratch in case the cleaned data were updated

db_connection

A DBIConnection object, as returned by dbConnect

Details

This function creates and updates a data table with the name tblname within a SQLite database located in dbdir and named dbname. The data table combines all play by play data for every available game back to the 1999 season and adds the most recent completed games as soon as they are available for nflfastR. The force_rebuild parameter controls if the data table within the database (not the database itself because there might be other data in it) should be removed and rebuilt from scratch (mostly because of bugfixes in nflfastR or its underlying data).

The parameter db_connection is intended for advanced users who want to use other DBI drivers, such as MariaDB, Postgres or odbc.