title: Embed in R markdown a googleVis chart generated using a function
body: <p>I have a function that creates the same type of <code>googleVis</code> plot for different data frames. These plots are to be embedded in a Markdown file. Embedding a single plot with the <code>result='asis'</code> option fails to achieve my objective when the chart object is created by my function. Following is a dummy code for the same:</p>
  
  <pre><code>Embedded googleVis plots
  =====================
  
  Some text here
  
  ```{r}
  library(googleVis)
  op &lt;- options(gvis.plot.tag="chart")
  ```
  
  And now the plot
  
  ```{r result='asis', tidy=TRUE}
  mark_func &lt;- function(data) {
      data$Mean=mean(data$Popularity)
      CC &lt;- gvisComboChart(data, xvar='City',
            yvar=c('Mean', 'Popularity'),
            options=list(seriesType='bars',
                         width=450, height=300,
                         title='City Popularity',
                         series='{0: {type:"line"}}'))
      return(CC)
  }
  ```
  
  ```{r result='asis', tidy=TRUE}
  plt &lt;- mark_func(CityPopularity)
  plot(plt)`
  ```  
  </code></pre>
  
  <p>I am converting this Markdown file to a HTML using <code>knit2html</code> from the <code>knitr</code> package and viewing this HTML in Firefox. Instead of seeing a plot, I see a long HTML code. </p>
  
  <p>What is it that I am missing? Thanks for your help.    </p>