[R] "Raw" histogram plots

hadley wickham h.wickham at gmail.com
Wed Feb 27 00:00:35 CET 2008


On Tue, Feb 26, 2008 at 4:10 PM, Andre Nathan <andre at digirati.com.br> wrote:
> Hello
>
>  I need to plot a histogram, but insted of using bars, I'd like to plot
>  the data points. I've been doing it like this so far:
>
>   h <- hist(x, plot = F)
>   plot(y = x$counts / sum(x$counts),
>        x = x$breaks[2:length(x$breaks)],
>        type = "p", log = "xy")

Another approach would be to use ggplot2, where all statistical
transformations can be performed separately from their traditional
appearance:

install.packages("ggplot2")
qplot(x, stat="bin", geom="bar")
qplot(x, stat="bin")

Hadley

-- 
http://had.co.nz/



More information about the R-help mailing list