R/read_file.R
R/read_file_raw.R
read_file.Rd
read_file() reads an entire file into a single character vector. read_file_raw() reads an entire file into a raw vector.
read_file()
read_file_raw()
read_file(path) read_file_raw(path)
A character string of the path to the file to read.
read_file(): A length 1 character vector.
read_file_raw(): A raw vector.
read_file() assumes the file has a UTF-8 encoding.
authors_file <- file.path(R.home("doc"), "AUTHORS") data <- read_file(authors_file) data_raw <- read_file_raw(authors_file) identical(data, rawToChar(data_raw)) #> [1] TRUE