I\'m plotting a categorical variable and instead of showing the counts for each category value.
I\'m looking for a way to get ggplot to display the perc
ggplot
this modified code should work
p = ggplot(mydataf, aes(x = foo)) + geom_bar(aes(y = (..count..)/sum(..count..))) + scale_y_continuous(formatter = 'percent')
if your data has NAs and you dont want them to be included in the plot, pass na.omit(mydataf) as the argument to ggplot.
hope this helps.