read_file: Read an entire file

Description Usage Arguments Details Value Examples

View source: R/read_file.R

Description

read_file() reads an entire file into a single character vector. read_file_raw() reads an entire file into a raw vector.

Usage

1
2
3

Arguments

path

A character string of the path to the file to read.

Details

read_file() assumes the file has a UTF-8 encoding.

Value

Examples

1
2
3
4
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))

Example output

Attaching package:brioThe following objects are masked frompackage:base:

    readLines, writeLines

[1] TRUE

brio documentation built on Dec. 11, 2021, 10:09 a.m.