R/readmultiline.R

Defines functions readMultiline

Documented in readMultiline

#' Read multiline text files
#' 
#' Read multiline text files, e.g. SQL query, JAGS code etc.
#' 
#' @param file     a connection to file, see \code{\link{readLines}}
#' @param sep      a character string to separate the lines read
#'                 from the file
#' @param encoding encoding to be assumed for input strings,
#'                 see \code{\link{readLines}}
#' 
#' @export

readMultiline <- function(file, sep = "\n", encoding = "unknown") {
  paste(readLines(file, encoding = encoding), collapse = sep)
}
twolodzko/twextras documentation built on May 3, 2019, 1:52 p.m.