fars_read: Read FARS data file

Description Usage Arguments Details Value Examples

Description

This is a simple function that, given a filename, opens the data and returns it in a dataframe. Throws an error if the filename is invalid.

Usage

1
fars_read(filename)

Arguments

filename

A character string giving the source file the function will read

Details

The function uses imported readr::read_csv() to open the file and dplyr::tbl_df() to coerce the dat into a tibble object.

Value

This function returns the FARS data in a tibble dataframe.

Examples

1
2
3
4
library(readr)
my_file <- system.file("extdata", "fars_data.zip", package = "fars")
unzip(my_file, junkpaths = TRUE)
fars_read("accident_2013.csv.bz2")

vadimus202/fars documentation built on May 3, 2019, 2:41 p.m.