title: Pie chart of frequency counts
body: <p>I've imported a 1-column excel file using <code>gdata</code>, the data is as follows </p>
  
  <pre><code>3 4 3 3 1 4 1 3 2 3 1 1 4 2 3 3 2 6 1 1 3 3 2 2 2 2 1 3 2 1 6 1 3 2 2 1 2 2 4 2
  </code></pre>
  
  <p>I'm using the <code>pie(md[, 1])</code> command to create a pie chart for the data, however, I'm getting the following chart when I do this:</p>
  
  <p><img src="https://i.stack.imgur.com/FWTz0.png" alt="Pie chart">.</p>
  
  <p>It's taking the data as 1-40 and then creating the pie width to the data sample rather than having 5 segments (1,2,3,4,6) with width created by the amount of times the result appears, i.e. the frequency counts of unique elements in the vector. How can I achieve that?</p>