s-news
[Top] [All Lists]

passing indices to a "by" function

To: <s-news@lists.biostat.wustl.edu>
Subject: passing indices to a "by" function
From: "Kattan, Michael" <kattanm@fastmail.fm>
Date: Fri, 23 Dec 2005 12:29:14 -0500
Reply-to: <kattanm@ccf.org>
Thread-index: AcYH3W93emkV5CiDScWyThOF5P5B9g==

I’m using the following code to produce 16 plots arranged 4 x 4:

 

Ø       par(mfrow=c(4,4))

Ø       by(my.dat,list(my.dat$agecat,my.dat$race),FUN=function(x) myfun(x)) #myfun does a special plot

 

 

I’d like to pass the “agecat” and “race” levels to the plots to identify them.  I guess ideally, I’d like the index labels to run across the top and down the left side of the 4 x 4 plots.  But passing the levels as plot subtitles wouldn’t be too bad.  Anyone have a tip for me?

 

Mike.

 

<Prev in Thread] Current Thread [Next in Thread>