1

[EDIT] updated for much simpler, reproducible output that generates same issue.

Code below. When I knit the code, only the first wordcloud shows up. I can put either function (month, year) in the first section and the plot will show. Why are my other plots not generating?

---
title: "Untitled"
output: html_document
---

```{r setup, include=FALSE}
library(RColorBrewer)
library(wordcloud2)
create.wordcloud <- function(text){
  return(wordcloud2(data=text, size = 0.8,
                    color='random-dark',
                    shape = "circle"))
}
test.1 <- table(LETTERS)
test.2 <- table(letters)
```

## Word Cloud for Calendar Year 2021:

```{r year, echo=FALSE}
create.wordcloud(test.1)
```

## Word Cloud by Month {.tabset .tabset-pills}
### January
```{r jan, echo=FALSE}
create.wordcloud(test.2)
```

##{}
AutoOffice
  • 29
  • 4
  • 1
    Maybe posting the actual .Rmd code would help. Then someone could paste it and run it. Also, if you could try to make your code minimal by cutting out as much as possible while still revealing the problem. – Michael Dewar Dec 10 '21 at 00:16
  • 1
    I have tried to reformat your code, but it's not reproducible as it stands because we don't have the data in `fd`. – neilfws Dec 10 '21 at 00:19

1 Answers1

2

Seems to be an issue with the package version on the CRAN. Get latest from:

remotes::install_github("lchiffon/wordcloud2")

Once I ran this snippet above and then your example again, I was able to produce the wordcloud plots

Jonni
  • 804
  • 5
  • 16