Skip to content
Prev 12123 / 398502 Next

by/ NA/ barplot

On Wed, 4 Jul 2001, S.McClatchie wrote:

            
[...]
barplot does not accept NAs.  That's a bug, I believe.  It will work if you
specify ylim, as in (modifying the first exammple)

tN <- table(Ni <- rpois(100, lambda=5))
tN[3] <- NA
r <- barplot(tN, col='gray')
Error in plot.window(xlim, ylim, log, asp, ...) :
        need finite ylim values

r <- barplot(tN, col='gray', ylim=c(0,25)) # works.

I assume you want the bar omitted in the NA cases.