read_text: Convert Text to Tidy-Text Format

View source: R/read_text.R

read_textR Documentation

Convert Text to Tidy-Text Format

Description

This function takes a character string or a path to a text file as input and converts it to tidy-text format. The resulting tibble contains one row for each line of the input text, along with the file name, and line number.

Usage

read_text(text)

Arguments

text

A character string containing the text to be converted, or a path to a text file.

Value

A tibble containing the converted text in tidy-text format, with columns for the text, file name, line number, and batch index (if applicable).

Examples

read_text("Hello, how are you?")
read_text("path/to/text/file.txt")


TheOpenAIR documentation built on April 27, 2023, 5:10 p.m.