title: How to draw a barplot from counts data in R?
body: <p>I have a data-frame 'x'</p>
  
  <p><a href="https://i.stack.imgur.com/WDYJZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WDYJZ.png" alt="X"></a></p>
  
  <p>I want barplot like this
  <a href="https://i.stack.imgur.com/X9qSF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/X9qSF.png" alt="enter image description here"></a></p>
  
  <p>I tried </p>
  
  <pre><code>barplot(x$Value, names.arg = x$'Categorical variable')
  ggplot(as.data.frame(x$Value), aes(x$'Categorical variable')
  </code></pre>
  
  <p>Nothing seems to work properly. In barplot, all axis labels (freq values) are different. ggplot is filling all bars to 100%.</p>