wordcloud encoding in shinyapps

雨燕双飞 提交于 2021-01-27 13:56:14

问题


I deplyed my shiny code with wordcloud package.

My local pc can shows perfectly but shinyapps show codes not characters.

My local one is window with no UTF-8, and other local is Ubuntu with UTF-8 both can shows good.

How can I fix it?

sample code server.R

library(wordcloud)

function(input, output, session) {


  d1 <- c("강릉교동짬뽕","강릉선교장","강릉오죽헌","강문해변","경포대")
  d2 <- c(35,126,192,322,452)
  d3 <- data.frame(poi_name=d1, n=d2)
  spider_cloud <- d3

  output$spider_cloud <- renderPlot({
    wordcloud_tmp <- spider_cloud
    wordcloud(wordcloud_tmp$poi_name, freq=wordcloud_tmp$n,
              scale=c(5,1), rot.per=0,
              min.freq = 1, max.words=100,
              random.order=F, colors=brewer.pal(8, "Dark2"))

  })
}

ui.R

plotOutput("spider_cloud")

captured in shinyapps

来源:https://stackoverflow.com/questions/39119094/wordcloud-encoding-in-shinyapps

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!