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. If the file does not exist, you get an error message. Second, if the CSV file exists, it is read into R. 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)

marmello77/FARS documentation built on Jan. 1, 2021, 9:18 a.m.