fars_read: Read motor vehicle crash csv file

Description Usage Arguments Value Examples

Description

This function (fars_read) validates that an input file exists. An error message is returned if the file does not exist. If the file exists then the file is read using the read_csv function from the readr package (read_csv). A data frame table is created using the tbl_df function from the dplyr package (tbl_df).

Usage

1
fars_read(filename)

Arguments

filename

A character string giving the path, name, and extension of a file to read in.

Value

This function returns a data frame table containing data for motor vehicle crashes for a particular year if the input csv file exists. An error message is returned if the file does not exist.

Examples

1
2
3
4
5
## Not run: 
fars_read("D:/Data/accident_2013.csv.bz2")
fars_read(filename="D:/Data/accident_2013.csv.bz2")

## End(Not run)

drsmd23/Fars documentation built on May 15, 2019, 2:54 p.m.