#' Import a tibble
#'
#' This is a simple function that returns csv format data as a tibble.
#' In case the file (as specified by \code{filename} doesn't exist the function
#' throws an error)
#'
#' @param filename A character string that specifies the path to the data file
#'
#' @return The function returns tibble data object
#'
#' In case the file path that as specified by \code{filename}
#' doesn't exist the function throws an error
#'
#'
#' @export
#'
fars_read <- function(filename) {
if(!file.exists(filename))
stop("file '", filename, "' does not exist")
data <- suppressMessages({
readr::read_csv(filename, progress = FALSE)
})
tibble::as.tibble(data)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.