fars_read: Import .csv flat files

Description Usage Arguments Details Value Note Examples

View source: R/fars_functions.R

Description

This function imports a .csv file. The parameter filename is meant to be passed a string from the function make_filename(). This function is used within the fars_read_years() function.

Usage

1
fars_read(filename)

Arguments

filename

A character string giving the name of the .csv file to be imported.

Details

This function first checks to make sure the file exists, and then, if it does exist, uses readr::read_csv() to import the file, suppressing import messages and the progress bar in the process. Finally, it uses dplyr::tbl_df() to convert the imported file to be a tibble data frame.

Value

This function returns a tibble.

Note

if a .csv file matching the filename you supply does not exist, the function will stop execution with message "file filename does not exist."

Examples

1
fars_read("accident_2015.csv.bz2")

john-s-christensen/fars documentation built on May 17, 2019, 3 p.m.