schunk: Chunk a string into parts

Description Usage Arguments Value Author(s) Examples

Description

Chunk a string into parts

Usage

1
2
schunk(x, size, brk = "-", indent.width1 = 0,
  indent.width = indent.width1, concat = TRUE)

Arguments

x

character, a string to chunk.

size

numeric, the size of a chunk.

brk

character to link broken words.

indent.width1

numeric, indent of the first line

indent.width

numeric, indent of the other lines

concat

logical, whether to concatenate by a 'newline'

Value

character

Author(s)

Xiaobei Zhao

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
x <- 'The quick brown fox jumps over the lazy dog.'
cat(schunk(x,15),'\n')
cat(schunk(x,15,indent.width1=4),'\n') # indent all lines
cat(schunk(x,15,indent.width=4),'\n')  # indent lines other than the first
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".

Xmisc documentation built on May 2, 2019, 8:23 a.m.