I have a very simple question causing me to bang my head on the wall.
I would like to scale the y-axis of my histogram to reflect the proportion (0 to 1) that each b
As of ggplot2 0.9, many of the formatter functions have been moved to the scales package, including percent_format().
library(ggplot2)
library(scales)
mydataframe <- data.frame(name = c("A", "B", "C", "D"),
value = c(0.0000354, 0.00768, 0.00309, 0.000123))
ggplot(mydataframe) +
geom_histogram(aes(x = value, y = ..ncount..)) +
scale_y_continuous(labels = percent_format())