title: R, Latex, Sweave, ggplot2 - change ggplot dimensions
body: <p>Cuurently I am working on a R Sweave report. And I am having some difficulties with the ggplot dimensions in the sweave pdf output. My code:</p>
  
  <pre><code>\documentclass{report}
  
  \begin{document}
  
  demo demo demo demo demo demo demo demo demo demo demo demo 
  
  \begin{figure}[h]
   \begin{center}
  &lt;&lt;echo=FALSE, fig=TRUE&gt;&gt;=
  require(ggplot2)
  df &lt;- data.frame(a= c(1:10), b = c (10:1))
  
  ggplot(data = df, aes(a, b)) + geom_line()
  @
    \caption{caption}
   \end{center}
  \end{figure}
  
  demo demo demo demo demo demo demo demo demo demo demo demo 
  
  \end{document}
  </code></pre>
  
  <p>Now I want to control the plot width and height dimensions in the pdf output. actually I want to keep the height the same but make the width as the same as the text width.</p>
  
  <p>Thanks for your time.</p>