fars_read: fars_read The fars_read function is importing data from a csv...

Description Usage Arguments Details Value Note Examples

View source: R/fars_functions.R

Description

fars_read The fars_read function is importing data from a csv file Note that in the given data set only years 2013, 2014, and 2015 exist.

Usage

1
fars_read(filename)

Arguments

filename

The argument/input for the function is a string with the filename

Details

fars_read is a helper function for fars_summarize_years and fars_read.

In case the file does not exist an error message is produced and execution stops.

Value

a tible of all accidents occured in the specific year and the 50 attributes per accident

Note

If the user does not enter a valid file name, an error message appears saying "file filename does not exist"

Examples

1
2
3
4
5
6
fars_read("accident_2013.csv.bz2")
# A tibble: 30,202 x 50
# The tibble starts with...
# STATE ST_CASE VE_TOTAL VE_FORMS PVH_INVL
#   <dbl>   <dbl>    <dbl>    <dbl>    <dbl>
# 1    1   10001        1        1        0

Sensalis/farsHK documentation built on Oct. 30, 2019, 11:51 p.m.