[R] Ask for histogram

Don MacQueen macq at llnl.gov
Wed Jan 13 21:47:34 CET 2010


If I do

    b <- rnorm(4332)
    hist(b,probability=T,breaks=30,col='lightblue',ylim=c(0,1))
    rug(b)

The plot looks entirely reasonable.

As far as being different from SAS, perhaps SAS and R use different 
breakpoints, that is, different boundaries between the histogram bars.

-Don

At 11:58 AM -0600 1/13/10, Yi Du wrote:
>Hi,
>
>
>I use a vector of data to draw the histogram, but it is different from the
>graph by SAS. Can you check it for me please?
>
>b is a column vector of 4332
>
>hist(b,probability=T,breaks=30,col='lightblue',ylim=c(0,1))
>rug(b)
>
>When I used rug, I find the records are smaller than 4332. I don't know
>where I did wrong.
>
>Thanks.
>
>--
>Yi Du
>
>	[[alternative HTML version deleted]]
>
>______________________________________________
>R-help at r-project.org 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.


-- 
--------------------------------------
Don MacQueen
Environmental Protection Department
Lawrence Livermore National Laboratory
Livermore, CA, USA
925-423-1062



More information about the R-help mailing list