-
Notifications
You must be signed in to change notification settings - Fork 2
/
README.Rmd
107 lines (73 loc) · 2.84 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
set.seed(424342)
```
# lorem::ipsum()
<!-- badges: start -->
[![CRAN status](https://www.r-pkg.org/badges/version/lorem)](https://CRAN.R-project.org/package=lorem)
[![lorem r-universe badge](https://gadenbuie.r-universe.dev/badges/lorem)](https://gadenbuie.r-universe.dev/lorem)
[![R-CMD-check](https://github.com/gadenbuie/lorem/actions/workflows/check-standard.yaml/badge.svg)](https://github.com/gadenbuie/lorem/actions/workflows/check-standard.yaml)
<!-- badges: end -->
* Quickly generate lorem ipsum placeholder text with `lorem::ipsum()`.
* Easy to integrate in RMarkdown documents.
* Includes an RStudio addin to insert *lorem ipsum* into the current document.
## Installation
You can install the latest released version of lorem from CRAN
``` r
install.packages("lorem")
```
or the current development version of lorem from GitHub or r-universe
``` r
# GitHub
# install.packages("remotes")
rmeotes::install_github("gadenbuie/lorem")
# R Universe
install.packages('lorem', repos = c('https://gadenbuie.r-universe.dev', 'https://cloud.r-project.org'))
```
## Usage
### RStudio Addin
**lorem** includes a simple addin for RStudio that
adds placeholder _lorem ipsum_ text to the current source document.
The addin allows you to specify the number of desired paragraphs and sentences.
### R Markdown
Another way to generate _lorem ipsum_ placeholder text is to call
`lorem::ipsum()` in an inline R chunk in R Markdown.
```markdown
`r knitr::inline_expr("lorem::ipsum(paragraphs = 2)")`
```
`r paste(">", lorem::ipsum(2), collapse = "\n>\n")`
You can control the number of `paragraphs` and `sentences` per paragraph.
```markdown
`r knitr::inline_expr("lorem::ipsum(paragraphs = 3, sentences = c(1, 2, 3))")`
```
`r paste(">", lorem::ipsum(3, 1:3), collapse = "\n>\n")`
You can also adjust the `avg_words_per_sentence` to create long or short paragraphs.
```markdown
`r knitr::inline_expr("lorem::ipsum(2, avg_words_per_sentence = 3)")`
```
`r paste(">", lorem::ipsum(paragraphs = 2, avg_words_per_sentence = 3), collapse = "\n>\n")`
```markdown
`r knitr::inline_expr("lorem::ipsum(1, avg_words_per_sentence = 20)")`
```
`r paste(">", lorem::ipsum(1, 2, avg_words_per_sentence = 20), collapse = "\n>\n")`
### Everywhere Else
Generate _lorem ipsum_ anywhere else using `lorem::ipsum()` or `lorem::ipsum_words()`.
```{r results='asis'}
ipsum_items <- replicate(5, lorem::ipsum_words(5))
cat(paste("-", ipsum_items), sep = "\n")
```
## Ipsum gratiam
Thank you to
[Luke Haas](https://getlorem.com)
for the node module
[getlorem](https://github.com/lukehaas/getlorem)
and for providing the lorem ipsum word list used in this package.