[Rd] tapply/barplot (PR#6983)

Peter Dalgaard p.dalgaard at biostat.ku.dk
Tue Jun 15 14:26:18 CEST 2004


Vidar.Hjellvik at imr.no writes:

> Hello,
> 
> there seems to be a bug in tapply or barplot in R 1.9.0 that was not in =
> earlier versions. The following code creates two nice barplots in 1.7.0, =
> but the first one is bad in 1.9.0:
> 
> par(mfrow=3Dc(1,2))
> x <- rep(1:10,10)
> y <- runif(100,1,100)
> z <- tapply(y,x,mean)
> barplot(z)
> barplot(as.numeric(z))

We know. Please check the relevant sources for previous reports, and,
in particular at this stage, the current 1.9.1beta!

> 
> although is.numeric(z) returns TRUE!

That's irrelevant: as.numeric does more than convert to numeric. Try
this for instance:

 m <- matrix(1:6,2)
 barplot(m)
 barplot(as.numeric(m))

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907



More information about the R-devel mailing list