Skip to contents

Downloads and loads a larger set of historical data into the database. Use this for initial setup or to rebuild the database.

Usage

initialize_database(
  db_path = "inst/extdata/irish_buoys.duckdb",
  start_date = Sys.Date() - 365,
  end_date = Sys.Date(),
  chunk_days = 365
)

Arguments

db_path

Path to DuckDB database file

start_date

Start date for historical data (default: 1 year ago)

end_date

End date for historical data (default: today)

chunk_days

Number of days to download at once (default: 30)

Value

Total number of records loaded

Examples

if (FALSE) { # \dontrun{
# Initialize with last year of data
records <- initialize_database(start_date = "2023-01-01")
} # }