I've tried multiple solutions to this from previous versions of ggplot answers, however, I have yet to find a way to change the scale from count to percent.
The structure of the data includes: deid
= an id variable; variable
a one-level factor; and value
= the participants response.
$ deid : int 123 155 332 224 654 325 865 654 555 434 ...
$ variable : Factor w/ 1 level "tx.rating": 1 1 1 1 1 1 1 1 1 1 ...
$ value : int 9 8 9 9 5 7 7 7 7 10 ...
Here is my code:
ggplot(tx.plot, aes(value, fill = variable)) +
geom_histogram(alpha = .6, binwidth = .5)
That creates:
I am hoping to get the percent responses from 0 - 10, not the count. I have tried to add scale_y_continuous
and scale_y_discrete
with the labels = percent command, however it has not worked and I receive error messages every time.