Skip to content
Prev 12386 / 63461 Next

barplot() does not draw bars correctly in R 1.9.0 (PR#6776)

On Fri, 16 Apr 2004 09:59:02 -0400 Duncan Murdoch wrote:

            
Of course, yes. Kurt and I have been working on this and as I recall
used mainly vectors and matrices for testing and obviously not 1-way
tables.
Yes, we changed it in that way so that the col, width and offset
arguments are expanded (if necessary) in a similar way. Compare for
example

  x <- cbind(1:3, 2)
  barplot(x, width = 1:2, beside = FALSE)
  barplot(x, width = 1:2, beside = TRUE)

in 1.8.1 and 1.9.0. In the new version the code tries to find a
(statistically) sensible grouping in both cases. One could argue that in
certain cases the widths of each bar should be controlled and they
should not be grouped...depends on what you want to do if length(width)
does not match the number of bars drawn.
Z