Hi Everyone,

I have a frequency data, which I am displaying with an area-curve-like plot in ggplot2 using:

ggplot(dfs, aes(x=values)) + geom_density(aes(group=ind))

The Y-axis that is returned is density, which is not really intuitive for my purposes and I would like to change it for proportions (i.e. the count of values at each bin divided by the total number of values).

I have found that I can change the y-axis to display counts or scaled proportions but not just the proportions.

something like +geom_density(aes(y = count/sum(count)))

This code does not work but I wonder if something like this possible?

Thanks,

Camilo




Camilo Mora, Ph.D.
Department of Geography, University of Hawaii
Currently available in Colombia
Phone:   Country code: 57
         Provider code: 313
         Phone 776 2282
         From the USA or Canada you have to dial 011 57 313 776 2282
http://www.soc.hawaii.edu/mora/

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to