fars_read: Read csv files into a data.frame / tbl_df

Description Usage Arguments Value Examples

Description

This basic function takes a csv file path and reads the file using readr::read_csv and dplyr::tbl_df. Note that dplyr::tbl_df (in the code) is deprecated and you should use tibble::as_tibble() instead. The code for this function is part of the Building R Packages course sourced from coursera. Example data is only available for 2013-2015. Requires readr and dplyr to run.

Usage

1
fars_read(filename)

Arguments

filename

Path to a csv file.

Value

Returns an object of the class data.frame, dbl_df, tbl.

Examples

1
2
3
4
5
6
## Not run: 
  df <- fars_read(file.path("data", "accident_2013.csv.bz2"))
  print(class(df))
  head(df)

## End(Not run)

simongarisch/R-Packages-Week-4 documentation built on May 29, 2019, 9:36 a.m.