title: Creating a wordcloud with shiny
body: <p>I am trying to create a wordcloud with shiny, where the cloud will change according to the selectinput. I am not able to use the variable created inside the reactive(), in renderplot. My scripts is following </p>
  
  <pre><code>library(shiny)
  #UI
  shinyUI(fluidPage(
   # Application title
   titlePanel("Word Clouds "),
   # Sidebar with a slider input for number of bins
   sidebarLayout(
     sidebarPanel(
       selectInput("var",
                "Choose Group:",
    choices= c("High","Low"),
    selected="Low")),
  
  # Show a plot of the generated distribution
  mainPanel(
    plotOutput("Plot1")))))
  
  
  # Server 
  # keeping dtm inside reactive function, bec it will change with every select input  
  
  library(shiny)
  library(slam)
  library(tm)
  library(RColorBrewer)
  library(wordcloud)
  data = read.csv("abc.csv")
  data = tolower(data)
  
  
  shinyServer(function(input, output) {
    data1 =reactive({
    sample_c=data[data$col1==input$var,]
    Corp &lt;- Corpus(VectorSource(sample_c$desc_copy))
    dtm=TermDocumentMatrix(Corp, control=list(weighting=weightTfIdf))     
    tdm.spar=removeSparseTerms(dtm, sparse=0.9)  
    ddm= rollup(tdm.spar,2,na.rm=TRUE, FUN=sum) # using slam package bec of huge data 
    m &lt;- as.matrix(ddm)
    v &lt;- sort(rowSums(m),decreasing=TRUE)
    d &lt;- data.frame(word = names(v),freq=v)
    list (d1=d)})
  
    wordcloud_rep &lt;- repeatable(wordcloud)
  
    output$Plot1 &lt;- renderPlot({
     data2=data1()$d1  
     set.seed(1234)
     wordcloud_rep(words = data2$word, freq = data2$freq, min.freq = 1,
            max.words=200, random.order=FALSE, rot.per=0.35, 
            colors=brewer.pal(8, "Dark2"))   }) })
  </code></pre>
  
  <p>I am receiving error </p>
  
  <blockquote>
    <p>invalid cex value</p>
  </blockquote>
  
  <p>again and again. I will really appreciate every help</p>