split_text: Split text into parts, each not exceeding a specified...

split_textR Documentation

Split text into parts, each not exceeding a specified character count

Description

Split text into parts, each not exceeding a specified character count

Usage

split_text(text, nchr_each = 200)

Arguments

text

Original text

nchr_each

Maximum character count for each part

Value

List of divided parts

Examples


original_text <- paste0(sample(c(letters, "\n"), 400, replace = TRUE), collapse = "")
parts <- split_text(original_text, nchr_each = 200)
lapply(parts, nchar)


pcutils documentation built on June 26, 2024, 1:06 a.m.