read_accidents: Read in STATS19 road safety data from .csv files downloaded.

Description Usage Arguments Details Examples

View source: R/read.R

Description

Read in STATS19 road safety data from .csv files downloaded.

Usage

1
2
read_accidents(year = NULL, filename = "", data_dir = tempdir(),
  format = TRUE)

Arguments

year

Single year for which data are to be read

filename

Character string of the filename of the .csv to read, if this is given, type and years determine whether there is a target to read, otherwise disk scan would be needed.

data_dir

Where sets of downloaded data would be found.

format

Switch to return raw read from file, default is TRUE.

Details

This is a wrapper function to access and load stats 19 data in a user-friendly way. The function returns a data frame, in which each record is a reported incident in the STATS19 data.

Examples

1
2
3
4
5
dl_stats19(year = 2011, type = "Accidents")
ac = read_accidents(year = 2011)

dl_stats19(year = 2009, type = "Accidents")
ac_2009 = read_accidents(year = 2009)

ITSLeeds/stats19 documentation built on May 4, 2019, 7:35 a.m.