Re: [R] multiple plots using a loop

2011-02-21 Thread Iain Gallagher
g for (i in Factor) cycles through every occurrence of a level and so you only get four plots of the last level rather than a plot for every level. cheers iain --- On Mon, 21/2/11, Darcy Webber wrote: > From: Darcy Webber > Subject: [R] multiple plots using a loop > To: r-help@r-project.or

Re: [R] multiple plots using a loop

2011-02-21 Thread Gabor Grothendieck
On Mon, Feb 21, 2011 at 4:25 AM, Darcy Webber wrote: > Dear R users, > > I am trying to write myself a loop in order to produce a set of 20 > length frequency plots each pertaining to a factor level. I would like > each of these plots to be available on the same figure, so I have used > par(mfrow

Re: [R] multiple plots using a loop

2011-02-21 Thread ONKELINX, Thierry
> Verzonden: maandag 21 februari 2011 12:45 > Aan: Darcy Webber > CC: r-help@r-project.org > Onderwerp: Re: [R] multiple plots using a loop > > Hi: > > Here's one way with the plyr package and function d_ply(); > the hist() function itself is not very elegant, bu

Re: [R] multiple plots using a loop

2011-02-21 Thread Dennis Murphy
Hi: Here's one way with the plyr package and function d_ply(); the hist() function itself is not very elegant, but it 'works' for this example. Factor <- rep(factor(letters[1:4]), each = 10) Size <- runif(40) * 100 library(plyr) par(mfrow = c(2, 2)) d <- data.frame(Factor, Size) # Function to pro

[R] multiple plots using a loop

2011-02-21 Thread Darcy Webber
Dear R users, I am trying to write myself a loop in order to produce a set of 20 length frequency plots each pertaining to a factor level. I would like each of these plots to be available on the same figure, so I have used par(mfrow = c(4, 5)). However, when I run my loop below, it produces 20 plo