0

Basically when I knit the R markdown the file shows just the Wordcloud, and not the leaflet map. If I invert the order everything works fine.

Any suggestion?

My chunks here:

library(tidytext)
library(wordcloud2)

wordcloud_data <- listings_NA%>%
  select(name)%>%
  unnest_tokens(input = name, output = word, token = "words")%>%
  count(word, sort = TRUE)%>%
  filter(n>10)

wordcloud2(wordcloud_data,
          shape = "diamond", 
          color = "White",
          backgroundColor = "steelblue",
          fontFamily = "Georgia")
  

print(leaflet(listings_NA %>%
          select(latitude, longitude, neighbourhood, price))%>%
  setView(lat = 40.863, lng =  14.2767,zoom = 12)%>%
  addTiles()%>%
  addMarkers(clusterOptions = markerClusterOptions()))



2
  • You need to show us a complete document if you want help debugging. Drop everything except these two chunks (and whatever setup they need), and put that in your post instead of a non-reproducible subset. Commented Feb 23, 2023 at 19:53
  • Please provide enough code so others can better understand or reproduce the problem.
    – Community Bot
    Commented Feb 23, 2023 at 22:15

0

Browse other questions tagged or ask your own question.