Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201867

Need help plotting a ggplot of percentage of categories in a dataframe in R

$
0
0

I have a data frame, that has some number of columns. Each of these columns has values that are categorical - Yes, Neutral and No. An example of the dataframe is below:

a = c('yes', 'yes', 'no', 'neutral', 'no', 'yes','no','neutral','neutral')
b = c('no', 'yes','no', 'no', 'no', 'neutral', 'yes', 'neutral','neutral')
abcd = data.frame(a,b)

I want to plot a ggplot - a Grouped (edited from stacked) bar plot that says for a - the number of yes, no and neutral and similarly for b. There are a lot of columns, so geom_bar() for each column is not feasible


Viewing all articles
Browse latest Browse all 201867

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>