2 years ago

#29110

test-img

firmo23

Set height and width in wordloud displayed in a shiny app

Is there any way to adjust the width and height of wordloud except of its size in order cover the whole screen in shiny app?

if(require(shiny)){
  library(wordcloud2)
  wordcloud2(data = demoFreq)
  
  # Global variables can go here
  n <- 1
  
  # Define the UI
  ui <- bootstrapPage(
    numericInput('size', 'Size of wordcloud', n),
    wordcloud2Output('wordcloud2')
  )
  
  
  # Define the server code
  server <- function(input, output) {
    output$wordcloud2 <- renderWordcloud2({
      # wordcloud2(demoFreqC, size=input$size)
      wordcloud2(demoFreq, size=input$size)
    })
  }
  # Return a Shiny app object
  # Sys.setlocale("LC_CTYPE","chs") #if you use Chinese character
  ## Do not Run!
  shinyApp(ui = ui, server = server)
}

r

shiny

wordcloud2

0 Answers

Your Answer

Accepted video resources