fars_read: Read data

Description Usage Arguments Value Examples

View source: R/FARS_functions.R

Description

This function reads data in CSV format into R. First, it checks whether the file already exists in the working directory. You get an error message if the file does not exist, y Second, the CSV file is read into R if it exists. Third, the data are converted to a tibble.

Usage

1
fars_read(filename)

Arguments

filename

A string with the full name of a file in CSV format. This function returns an error, if the file does not exist in the directory.

Value

This function returns a data frame in tibble format.

Examples

1
2
3
4
5
6
## Not run: 
fars_read("accident_2013.csv")
fars_read("accident_2014.csv")
fars_read("accident_2015.csv")

## End(Not run)

anamikapoyil/FARS documentation built on Dec. 23, 2021, 12:15 a.m.