Here is my example
mydf = data.frame('col_1' = c('A','A','A', 'B','B'),
'col_2' = c('positive', 'negative', 'negative', 'positive', 'positive'))
mydf
ggplot(data=mydf, aes(x = col_1, fill = col_2))+ geom_bar(stat='count')
I would like bar to add up to 100%. So first bar will show split 33% and 67% and second bar will be 100 %
I know how to manipulate data, but I don't know how to cast it into format necessary for ggplot.
Any suggestions?