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()))