ipsum {lorem} | R Documentation |
Generate Lorem Ipsum Text
Description
Generates lorem ipsum placeholder text for the requested number of sentences or paragraphs. You can control the number of sentences per paragraph and the average number of words per sentence, or simply enter the number of desired paragraphs for a completely random experience.
lorem::ipsum()
uses sampling and the random number generator and makes no
effort to shield the placeholder text generation from the main script, so
please only use this package for temporary placeholder text.
Usage
ipsum(paragraphs = 1, sentences = NULL, avg_words_per_sentence = 10)
ipsum_words(n, collapse = TRUE)
ipsum_starts(n)
Arguments
paragraphs |
Number of paragraphs of text to generate. |
sentences |
Number of sentences per paragraph. If |
avg_words_per_sentence |
Number of expected words per sentence. |
n |
Number of words to generate |
collapse |
Should the words be collapsed into a single string, separated
by spaces (default)? If |
Value
A character vector of lorem ispum placeholder text, where each element in the vector is a paragraph of text.
Functions
-
ipsum()
: Generate paragraphs and sentences of lorem ipsum text. -
ipsum_words()
: Generate lorem ipsum words, without punctuation. -
ipsum_starts()
: Generate lorem ipsum starting words.
Options
You can influence, to a degree, the amount of punctuation that is included
in the output using the lorem.punctuation_valence
option. This global
option should be a number between 0 and 1, or FALSE
to disable
punctuation altogether. When the value is closer to 1, more punctuation is
included in the sentences. When the value is closer to 0, less punctuation
will be inserted. The default value is 0.4.
Examples
# 1 paragraph of text
lorem::ipsum(1)
# 2 paragraphs with 2 and 3 sentences each
lorem::ipsum(2, sentences = c(2, 3))
# 2 paragraphs with short sentences
lorem::ipsum(2, avg_words_per_sentence = 4)
# 2 paragraphs with long sentences
lorem::ipsum(2, avg_words_per_sentence = 20)