R/fars_read.R

Defines functions fars_read

Documented in fars_read

#' Read data file.
#'
#' This reads the bz2 file to be used in other functions of this package.
#' Users do not have to see the result of this function, thus it is not exported.
#' @param filename The name of the file to be called.
#' @return This function returns a part of file as a printed table.
#' @importFrom readr read_csv
#' @importFrom dplyr tbl_df
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)
}
oceanofscience/week2job documentation built on May 6, 2019, 5 p.m.