#' fars_functions
#'
#' Reads data from a delimited file and returns it as a data frame.
#'
#' @param filenmae A character string containing the path and name of the file to read. Remeber to include a path if the file is not in the current directory.
#'
#' @return Returns a data frame
#'
#' @importFrom dplyr tbl_df
#' @importFrom readr read_csv
#'
#' @examples fars_read('../data/accident_2013.csv.bz2')
#'
#' @note Returns an error if the file does not exist.
#'
#' @export
fars_read <- function(filename) {
if(!file.exists(filename))
stop("file '", filename, "' does not exist")
data <- suppressMessages({
readr::read_csv(filename, progress = FALSE)
})
dplyr::tbl_df(data)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.