From p.dalgaard at biostat.ku.dk  Tue Jun 15 14:26:18 2004
From: p.dalgaard at biostat.ku.dk (Peter Dalgaard)
Date: Tue Jun 15 14:33:44 2004
Subject: [Rd] tapply/barplot (PR#6983)
In-Reply-To: <20040615122005.D794C105A2@slim.kubism.ku.dk>
References: <20040615122005.D794C105A2@slim.kubism.ku.dk>
Message-ID: <x2n035hus5.fsf@biostat.ku.dk>

Vidar.Hjellvik@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@biostat.ku.dk)             FAX: (+45) 35327907


[Rd] tapply/barplot (PR#6983)
Peter Dalgaard