Learn R Programming

Xmisc (version 0.0.9)

schunk: Chunk a string into parts

Description

Chunk a string into parts

Usage

schunk(x, size, brk = "-", concat = TRUE)

Arguments

x
character, a string to chunk.
size
numeric, the size of a chunk.
brk
character to link broken words.
concat
logical, whether to concatenate by a `newline`

Value

  • character

Examples

Run this code
x <- 'The quick brown fox jumps over the lazy dog.'
cat(schunk(x,15),'\n')
x <- 'The word, honorificabilitudinita, occurs in Shakespeare\'s
play Love\'s Labour\'s Lost, and means "with honorablenesses".'cat(schunk(x,30),'\n')
## The word, honorificabilitudini-
## ta, occurs in Shakespeare's
## play Love's Labour's Lost, and
##  means "with honorablenesses".

Run the code above in your browser using DataLab