dl_stats19: Download STATS19 data for a year

View source: R/dl.R

dl_stats19R Documentation

Download STATS19 data for a year

Description

Download STATS19 data for a year

Usage

dl_stats19(
  year = NULL,
  type = NULL,
  data_dir = get_data_directory(),
  file_name = NULL,
  ask = FALSE,
  silent = FALSE,
  timeout = 600
)

Arguments

year

Single year for which data are to be read

type

One of 'collision', 'casualty', 'Vehicle'; defaults to 'collision'.

data_dir

Where sets of downloaded data would be found.

file_name

Character string of a specific STATS19 CSV filename to download/read. If NULL, filenames are inferred from year and type.

ask

Should you be asked whether or not to download the files? TRUE by default.

silent

Boolean. If FALSE (default value), display useful progress messages on the screen.

timeout

Timeout in seconds for the download if current option is less than this value. Defaults to 600 (10 minutes).

Examples


if (curl::has_internet()) {
  # type by default is collisions table
  dl_stats19(year = 2022)
}


stats19 documentation built on March 18, 2026, 5:08 p.m.