Skip to content

histogram for integer data

6 messages · Don MacQueen, Erwann.Rogard at sanofi-aventis.com, Henrique Dallazuanna +1 more

#
You might consider something based on the concept of:

   y <- table( x)
   plot( as.numeric(names(y)) , y, type='h')

-Don
At 2:59 PM -0400 3/27/08, <Erwann.Rogard at sanofi-aventis.com> wrote:

  
    
#
Thanks!

Yes, but I also want to be able to condition easily hence
histogram(...), not plot


-----Original Message-----
From: Don MacQueen [mailto:macq at llnl.gov] 
Sent: Thursday, March 27, 2008 3:55 PM
To: Rogard, Erwann R&D/US/EXT; r-help at r-project.org
Subject: Re: [R] histogram for integer data

You might consider something based on the concept of:

   y <- table( x)
   plot( as.numeric(names(y)) , y, type='h')

-Don
At 2:59 PM -0400 3/27/08, <Erwann.Rogard at sanofi-aventis.com> wrote:
--
--------------------------------------
Don MacQueen
Environmental Protection Department
Lawrence Livermore National Laboratory
Livermore, CA, USA
925-423-1062
#
Hi,

1)
par(ask=TRUE)
histogram(~Y|F1 * F2 * F3,data = ...)

Successively displays many plots as the # of levels in F3 w/o asking for
input between each.
In other words I only get to see the plot for the last level. What's the
right commands?


2)
Also I am wondering if there are plot objects i.e. something like
obj<-plot(x,y)

Thanks!
#
On 28/03/2008, Erwann.Rogard at sanofi-aventis.com
<Erwann.Rogard at sanofi-aventis.com> wrote:
for this you can do:

plot(x, y)
x <- recordPlot()
replayPlot(x)

  
    
#
On Fri, 28 Mar 2008, Erwann.Rogard at sanofi-aventis.com wrote:

            
library(grid)
?grid.prompt.

par() applies only to base graphics, and you are using grid 
(via lattice) here.

In 2.7.0 you will use devAskNewPage() instead, and this applies to the 
device and not the graphics subsystem.
Yes, in the lattice and ggplot[2] systems, and (in a different way) in teh 
grid graphics subsystem they are built on.