fars_read: FARS Data Input.

Description Usage Arguments Details Value Depends on Examples

Description

This functions reads a file in table format, and returns it as an object of the "tbl_df" class. If the file does not exist in the current directory, this function stops execution with an error message. While reading all messages are suppressed.

Usage

1
fars_read(filename)

Arguments

filename

A character string giving the filename of the csv file to be read

Details

This function uses the read_csv() function from the readr package, with progress = FALSE parameter. Then the tbl_df(), function from the dplyr package is called to convert the data into the tabl_df format before returing it.

Value

returns a data frame table if the file exists, throws an error if the file doesn't exist.

Depends on

  1. read_csv in the readr package.

  2. tbl_df in the dplyr package.

Examples

1
2
3
4
## Not run: 
  fars_read("accident_2014.csv.bz2")

## End(Not run)

CarlosSilva34/fars documentation built on May 23, 2019, 11:36 p.m.