如何更改R
中闪亮的wordcloud的大小,以免剪切图像?
我使用了png()
函数,但没有得到结果:
output$plot2 <- renderPlot({
terms2 <- reactive({
# Change when the "update" button is pressed...
input$update
data2 <- input$texto1
# ...but not for anything else
isolate({
withProgress({
setProgress(message = "Processing corpus...")
getTermMatrix2(data2)
})
})
})
v2 <- terms2()
wordcloud_rep2(names(v2), v2, scale=c(4,0.5),
min.freq = 1, max.words=20,
colors=brewer.pal(8, "Dark2"))
})
答案 0 :(得分:0)
使用wordcloud2代替wordcloud。
它的基本需求是两列单词和频率来呈现单词云,
它也有自己的renderoutput和renderwordcloud。
我附上了例子看看。
this is how your data should look like:
words freq
oil 85
said 73
prices 48
library(wordcloud2)
library(shiny)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(),
dashboardBody(
wordcloud2Output('cloud')
)
)
server <- function(input, output) {
output$cloud <- renderWordcloud2({
wordcloud2(demoFreq)
})
}
shinyApp(ui, server)