fars_read: fars_read

Description Usage Arguments Details Value Examples

Description

This function takes in "filename" as an argument, and first checks whether any file with name equal to "filename" exists.

Usage

1
fars_read(filename)

Arguments

filename

A character string denoting the file to be read by fars_read.

Details

If the file does not exists, fars_read will stop and returns a message to indicate that the file does not exist.

If the file exists, fars_read will to read the file using the read_csv function from the readr package into a table named "data". It will then run the tbl_df function from the dplyr package to convert data into a data frame and return it as output to the function.

Value

This function either returns a data frame containing data extracted from the defined file if it is present, or a message indicating the file is not found otherwise.

Examples

1
fars_read(make_filename (2015))

izlude83/week4 documentation built on May 14, 2019, 6:03 a.m.