fars_read: Read "Fatality Analysis Reporting System" datasets

Description Usage Arguments Value Note Examples

View source: R/fars_functions.R

Description

The "fars_read" function reads a csv format FARS dataset. You can customize the file to read (using the filename argument). If you do not save it to a variable, the function will print out information about the dataset to the console.

Usage

1
fars_read(filename)

Arguments

filename

A file path where the dataset is available

Value

This function returns a dataset as a "data.frame" (and also incorporates the dplyr package's "tbl_df" and "tbl" classes). Additionally, it prints out information about the dataset to the console if a variable name to save is not defined.

Note

There is an "if" condition in the beginning, which checks if the given file path exists, results in an error if returns FALSE.

Examples

1
2
3
4
5
## Not run: 
fars_read("accident_2013.csv.bz2")
fars.df <- fars_read("accident_2014.csv.bz2")

## End(Not run)

Solymi90/Fars.Assignment documentation built on May 27, 2019, 7:24 a.m.