scottyv@bell-labs.com
2002-Dec-13 19:45 UTC
[R] histogram bug?: type='count', unequal breaks
I ask for a histogram of counts with slightly uneven breaks but histogram() ignores the 'type' argument and provides density scaling instead. x = sample(1:3, 100, replace=TRUE) histogram( ~ x, breaks=c(0,1.5,2.5,3.5), type='count') My real application has time data with month boundaries for the breaks and I DO want counts on the y-axis. A work-around is not difficult but shouldn't histogram honor the type argument when given? Scott Vander Wiel Statistics and Data Mining Research Bell Laboratories, Lucent Technologies
On Friday 13 December 2002 12:43 pm, scottyv at bell-labs.com wrote:> I ask for a histogram of counts with slightly uneven breaks but > histogram() ignores the 'type' argument and provides density scaling > instead. > > x = sample(1:3, 100, replace=TRUE) > histogram( ~ x, breaks=c(0,1.5,2.5,3.5), type='count') > > My real application has time data with month boundaries for the breaks > and I DO want counts on the y-axis. > > A work-around is not difficult but shouldn't histogram honor the > type argument when given?Yes, it should, and it doesn't because of a bug in the released version of lattice. This should be fixed in the next release (hopefully sometime next week). Deepayan