R/import-txt.R

Defines functions import_txt

Documented in import_txt

#' Import text file 
#'
#' @param filepath a string indicating the relative or absolute
#'     filepath of the file to import
#' 
#' @return a [tibble][tibble::tibble-package] of each row
#'   corrresponding to a line of the text file, with the column named
#'   "text"
import_txt <- function(filepath){
  readLines(filepath) %>%
  #paste(readLines(filepath), collapse = "\n") %>%
    tibble::tibble(text=.)
}
jcai849/iNZightTA documentation built on Dec. 2, 2020, 6:59 a.m.