fars_read: Reading an input file.

Description Usage Arguments Details Value Examples

Description

This function checks whether a given file exists or not. If the file exists , it reads the file into a data frame. Otherwise it throws an error with the message "File <filename> does not exists".

Usage

1
fars_read(filename)

Arguments

filename

This can be either a variable holding the name of the file or the filename itself.

Details

Reads input file containing data regarding fatal injuries suffered in motor vehicle traffic crashes.

If the system is not able to locate the given file in the current working directory or the complete filename is not provided, this function will throw an error.

Value

This function returns a data frame for the input file.

Examples

1
2
3
4
fars_read("accident_2013.csv")
fars_read("accident_2015.csv")
data1<-"data/accident.csv"
fars_read(data1)

sonam-sharma/pushrepo documentation built on May 30, 2019, 4:10 p.m.