fars_read: Reading a csv file into R

Description Usage Arguments Details Value Examples

View source: R/fars_functions.R

Description

The function fars_read gets as input the path of the file name to load into R. It checks whether the file exists and if not, stops. If the file exists, with correct format, it is loaded into R with the read_csv function from the readr package and messages,which type each column is, are suppressed. At least, the function uses the tbl_df function from the dplyr package, although there is no need to do that.

Usage

1
fars_read(filename)

Arguments

filename

A string containing the path for the file

Details

Erros occur by files which exist but are not in (zipped) csv format, or files which are in csv format but do not have the default delimiters. Error occurs if more than one filename is passed.

Value

A tibble dataframe containing the information of the csv file

Examples

1
2
# filename <- make_filename(2013)
# accident_2013 <- fars_read(filename)

alex2905/coursera documentation built on May 17, 2019, 8:04 a.m.