R/read_file.R

Defines functions read_file

Documented in read_file

#' read_file
#'
#' reads a file into the console line-by-line.
#' @usage read_file(filepath)
#' @param filepath path to file to be read.
#' @export

read_file <- function(filepath){
  con <- file(filepath, "r")
  while(TRUE){
    line <- readLines(con, n = 1)
    if (length(line) == 0){break}
    print(line)
  };close(con)
}
schuyler-smith/schuylR documentation built on Feb. 8, 2022, 12:25 p.m.