Re: [R] using hist() with tapply()

From: Kjetil Brinchmann Halvorsen <>
Date: Thu 02 Sep 2004 - 07:58:59 EST

Schwarz,Paul wrote:

>I've been passing the hist() function to tapply() to quickly generate histograms based on the list of factors supplied to tapply(). However, I have not figured out how to generate titles for each of the histograms, which paste in the unique values of the list factors as part of the histogram title. I'm hoping that someone can tell me how to do this.
>Thanks for your time and consideration,
>-Paul Schwarz
> mailing list
>PLEASE do read the posting guide!
I can't see it with talpply, but mapply and split works:

test <- rnorm(1000)
fac <- factor( rep(1:5, 200))
mapply(hist, split(test, fac), main=levels(fac))


Kjetil Halvorsen.

Peace is the most effective weapon of mass construction.
               --  Mahdi Elmandjra

______________________________________________ mailing list
PLEASE do read the posting guide!
Received on Thu Sep 02 13:38:17 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:56:25 EST