fars_read: Read csv.bz2 file and create a data frame tbl.

Description Usage Arguments Value Examples

Description

This is a function that read a csv.bz2 file. You can manually write the name of the csv.bz2 file in the filename parameter and it is utilized in conjuntion with the make_filename function for files obtain from the US National Highway Traffic Safety Administration's that have this nomenclature "accident_ It will return a tibble object that have all these classes: 'tbl_df', 'tbl' and 'data.frame'. The function return an error message if the file does not exist or if it is not find.

Usage

1
fars_read(filename)

Arguments

filename

A csv.bz2 file that can be explicitly specify or from a string "character" generated with the make_filename function of this package.

Value

This function returns the dataframe tbl from an input that is a csv.bz2 file.

Examples

1
2
3
4
5
6
## Not run: 
data <- fars_read(filename = "./accident_2013.csv.bz2")
file<-make_filename(year=2013)
data<-fars_read(filename = file)

## End(Not run)

friveramariani/fars documentation built on May 7, 2019, 7:57 a.m.