title: How to use ggplot2 to generate a pie graph?
body: <p>I have a vector of values that I would like to display as a pie chart. The vector consists of 1's, 2's, and 3's, and I would like my pie chart to display the percentage of 1's, 2's, and 3's in the vector in addition to labels for the areas. The 1's would be Democrats, 2's Republicans, and 3's Independents. The vector that I have been working with is a column of a dataframe. There may be some type issues, although I've passed it using as.numeric() and as.factor().</p>
  
  <p>Here is an example of the df (note, as you can see in the code, I'm intersted in col Q7):</p>
  
  <pre><code>  Q6 Q7 Q8 Q9
  3 30  3  5  1
  4 30  3  5  1
  5 65  3  2  2
  6 29  3  5  1
  7 23  1  4  1
  8 24  1  5  1
  </code></pre>
  
  <p>Here is the code that I have been trying:</p>
  
  <pre><code>install.packages('ggplot2')
  library(ggplot2)
  
  # pie graph for party
  pie &lt;- ggplot(data=data, aes(x = as.factor(data$Q7), fill = factor(cyl)))
  pie + coord_polar(theta = "y")
  </code></pre>
  
  <p>It returns an error: 'No layers in plot'</p>
  
  <p>Thanks for the help!</p>