[R] Fwd: Why do histogram bars vary their width?

David Winsemius dwinsemius at comcast.net
Sat Dec 26 17:09:55 CET 2009


On Dec 26, 2009, at 10:38 AM, James Rome wrote:

> I did
>
> histogram(~(Arrival4) | as.factor(Hour), type="count",
> breaks=16,ylab="Arrival Count",
>  xlab="Arrival Rate/4",main="Friday EWR A22R D22L Configiration",
>  layout=c(6,4), par.strip.text=list(cex=0.7))
>
> Why do I get plots with different bar widths? See http://dl.dropbox.com/u/537118/Friday.pdf 
> .
>
> Although
>
> bins=seq(-.5,15.5,1)

  identical(seq_len(1 + nlevels(x)) - 0.5 , seq(-.5,15.5,1) )
[1] FALSE

>
> histogram(~(Arrival4) | as.factor(Hour), type="count",  
> breaks=bins,ylab="Arrival Count",
>  xlab="Arrival Rate/4",main="Friday EWR A22R D22L Configiration",
>  layout=c(6,4), par.strip.text=list(cex=0.7))
>
> seems to work properly.
>
> Thanks,
> Jim Rome
>
> ______________________________________________
> 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.

David Winsemius, MD
Heritage Laboratories
West Hartford, CT




More information about the R-help mailing list