read_lines: Read text lines from a file

View source: R/read_lines.R

read_linesR Documentation

Read text lines from a file

Description

The file is assumed to be UTF-8 and the resulting text has its encoding set as such.

Usage

read_lines(path, n = -1)

Arguments

path

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

n

integer. The number of lines to read. A negative number means read all the lines in the file.

Details

Both '\r\n' and '\n' are treated as a newline.

Value

A UTF-8 encoded character vector of the lines in the file.

Examples

authors_file <- file.path(R.home("doc"), "AUTHORS")
data <- read_lines(authors_file)

brio documentation built on May 29, 2024, 6:41 a.m.