Skip to contents

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 NULL, then a random number of sentences per paragraph (approximately 3-8) will be chosen. Alternatively, sentences can be a vector of integers representing the number of sentences per paragraph.

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 FALSE, the chosen words are returned as a character vector.

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)
#> <lorem>
#> Sit pellentesque cum nam sem, nunc orci dis nascetur eros! Fusce cras
#> phasellus feugiat mollis! Turpis posuere, iaculis non curabitur litora
#> volutpat urna iaculis! Sociosqu cubilia sed, augue accumsan donec;
#> inceptos dictum sollicitudin. Suspendisse scelerisque nec congue
#> sollicitudin sed dictumst urna felis, sollicitudin morbi porta?

# 2 paragraphs with 2 and 3 sentences each
lorem::ipsum(2, sentences = c(2, 3))
#> <lorem>
#> Ipsum dapibus primis ante nascetur egestas metus pharetra duis netus
#> etiam conubia! Curabitur vivamus eget lobortis fusce – convallis sociis
#> ultrices magnis nisl ad, leo auctor risus.
#> 
#> Consectetur pretium felis litora, mattis magnis mus, netus felis non,
#> imperdiet praesent integer semper eu. Dictumst sodales semper egestas
#> pharetra curabitur ridiculus odio leo ullamcorper? Suspendisse nunc
#> rhoncus penatibus ante.

# 2 paragraphs with short sentences
lorem::ipsum(2, avg_words_per_sentence = 4)
#> <lorem>
#> Consectetur aptent mauris mollis? Fermentum mattis aliquet tellus.
#> Viverra eros curae nostra. Ante convallis montes auctor! Arcu pretium
#> interdum luctus eros! Na eros.
#> 
#> Amet sed scelerisque nunc. Litora maecenas ac platea malesuada. Mi
#> parturient: nostra pharetra luctus! Quam parturient mus pharetra
#> commodo. Tellus eleifend vestibulum malesuada magna. Parturient porta
#> tellus mus facilisi. Na facilisi?

# 2 paragraphs with long sentences
lorem::ipsum(2, avg_words_per_sentence = 20)
#> <lorem>
#> Sit quam nostra vivamus habitant lobortis arcu, felis scelerisque donec
#> metus nibh. Ad ridiculus nisi ornare tortor tempus mattis ullamcorper
#> dui: curae ullamcorper nunc curabitur. Penatibus posuere, et aliquet
#> quis habitant platea. Libero convallis quis aliquam? Auctor eros,
#> sagittis fermentum placerat orci, lectus at a. Vel erat semper aliquet
#> arcu potenti ridiculus sapien fames! Mi euismod suscipit odio quam
#> elementum magna magna pellentesque diam tempus massa primis posuere
#> montes aenean penatibus curae lacus eros quam et erat senectus volutpat
#> fames est nullam sem orci nulla lacinia fermentum suscipit interdum
#> himenaeos accumsan suspendisse fames, netus rutrum eleifend, dui,
#> blandit – dis hac vulputate, leo eu sodales, mi, nostra metus accumsan
#> ornare porta feugiat arcu integer laoreet, purus consequat, odio id
#> molestie libero erat pulvinar habitant gravida netus integer potenti ut
#> et lacus fermentum montes taciti vulputate placerat vestibulum sem
#> porttitor non erat quis aliquam.
#> 
#> Dolor magna gravida neque odio lectus eu eu condimentum odio erat!
#> Sociosqu natoque nisi nullam sed accumsan – torquent nam vitae tellus?
#> Fusce semper nisi nam blandit placerat nostra metus imperdiet potenti.
#> Aliquam auctor scelerisque mollis, nostra tempus dapibus nunc quam
#> sollicitudin natoque mi urna nunc leo cum quis platea, felis ad nulla
#> eleifend eleifend, curae, interdum, in eget aliquam, torquent netus,
#> cras nulla suspendisse vitae, vestibulum convallis iaculis justo nisi
#> cursus tempor varius netus urna: bibendum sociosqu sollicitudin lectus
#> blandit nunc ultricies ut.