Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

stri_rand_lipsum

A Lorem Ipsum Generator


Description

Generates (pseudo)random lorem ipsum text consisting of a given number of text paragraphs.

Usage

stri_rand_lipsum(n_paragraphs, start_lipsum = TRUE, nparagraphs = n_paragraphs)

Arguments

n_paragraphs

single integer, number of paragraphs to generate

start_lipsum

single logical value; should the resulting text start with Lorem ipsum dolor sit amet?

nparagraphs

deprecated alias of n_paragraphs

Details

Lorem ipsum is a dummy text often used as a source of data for string processing and displaying/lay-outing exercises.

The current implementation is very simple: words are selected randomly from a Zipf distribution (based on a set of ca. 190 predefined Latin words). The number of words per sentence and sentences per paragraph follows a discretized, truncated normal distribution. No Markov chain modeling, just i.i.d. word selection.

Value

Returns a character vector of length n_paragraphs.

See Also

Examples

cat(sapply(
   stri_wrap(stri_rand_lipsum(10), 80, simplify=FALSE),
   stri_flatten, collapse='\n'), sep='\n\n')
cat(stri_rand_lipsum(10), sep='\n\n')

stringi

Character String Processing Facilities

v1.6.1
file LICENSE
Authors
Marek Gagolewski [aut, cre, cph] (<https://orcid.org/0000-0003-0637-6028>), Bartek Tartanus [ctb], and others (stringi source code); IBM, Unicode, Inc. and others (ICU4C source code, Unicode Character Database)
Initial release
2021-05-05

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.