-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.Rmd
50 lines (41 loc) · 977 Bytes
/
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
---
title: "ggspell"
output: github_document
---
```{r, include = FALSE, cache = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
out.width = "100%",
cache = TRUE
)
asciicast::init_knitr_engine(
echo = TRUE,
echo_input = FALSE,
startup = quote({
library(ggspell)
set.seed(1) })
)
```
Spell check text and ggplot objects with the LanguageTool API.
Install like this:
```{r eval=FALSE}
remotes::install_github("nicucalcea/ggspell")
```
Use like this for text.
```{asciicast}
# Check text
ggspell::ggspell("This is a error.")
```
Or check an entire plot.
```{asciicast}
# Check plot
starwars_plot <- dplyr::starwars |>
head(10) |>
ggplot2::ggplot(ggplot2::aes(x = height, y = name)) +
ggplot2::geom_col() +
ggplot2::geom_text(x = 168.7, y = 10, label = "Firstannotation") +
ggplot2::labs(title = "This an title mispeling some words",
subtitle = "The subtitle has also erors ,like")
ggspell::ggspell(starwars_plot)
```