title: ERROR: cannot coerce type 'environment' to vector of type 'character' with ggplot
body: <p>I am attempting to leverage ggplot code found on SO.  The problem is i keep getting errors and i think it has something to do with trying to pass the the functions through shinydashboard.  I've tried all sorts of things.  I can get this to render fine in the console but not in shinydashboard.</p>
  
  <pre><code> library(shinydashboard)
   library(shiny)
   library(ggplot2)
   library(dplyr)
  
   ui &lt;- fluidPage(
     gggauge(52,breaks=c(0,35,70,100)
   )
  
   )
   server &lt;- function(input, output) {
     gggauge &lt;- function(pos,breaks=c(0,30,70,100)) {
       get.poly &lt;- function(a,b,r1=0.5,r2=1.0) {
         th.start &lt;- pi*(1-a/100)
         th.end &lt;- pi*(1-b/100)
         th &lt;- seq(th.start,th.end,length=100)
         x &lt;- c(r1*cos(th),rev(r2*cos(th)))
         y &lt;- c(r1*sin(th),rev(r2*sin(th)))
         return(data.frame(x,y))
       }
       ggplot()+ 
        geom_polygon(data=get.poly(breaks[1],breaks[2]),aes(x,y),fill="red")+
        geom_polygon(data=get.poly(breaks[2],breaks[3]),aes(x,y),fill="gold")+geom_polygon(data=get.poly(breaks[3],breaks[4]),aes(x,y),fill="forestgreen")+
        geom_polygon(data=get.poly(pos-1,pos+1,0.2),aes(x,y))+
        geom_text(data=as.data.frame(breaks), size=5, fontface="bold", vjust=0,
          aes(x=1.1*cos(pi*(1-breaks/100)),y=1.1*sin(pi*(1-breaks/100)),label=paste0(breaks,"%")))+
        annotate("text",x=0,y=0,label=pos,vjust=0,size=8,fontface="bold")+
        coord_fixed()+
        theme_bw()+
        theme(axis.text=element_blank(),
          axis.title=element_blank(),
          axis.ticks=element_blank(),
          panel.grid=element_blank(),
          panel.border=element_blank()) 
     }
   }
   shinyApp(ui = ui, server = server)
  </code></pre>