Re: [R] loop and plot

2009-10-19 Thread Rene
Dear all, I am stuck at applying loop function for creating separated plots. I have coding like below: dataset.table - table(data.frame(var1=c(1,2,3,1,2,3,1),colour=c(a,b,c,c,a,b,b) )) kk = function(f) { ls=as.character(f) pie(dataset.table[ls,],main=ls)

Re: [R] loop and plot

2009-10-19 Thread joris meys
Hi Rene, the problem is probably due to the fact that R will send all plots to the same graphical output window. Each next plot just replaces the previous one. if it's only a few plots, you can divide the graphical window with the commands par(mfrow=...) (see ?par) or layout(matrix(...)) (see

Re: [R] loop and plot

2009-10-19 Thread joris meys
()              }              } par(mfrow=(3,2)) kk(1:3) Thanks a lot! Rene -Original Message- From: joris meys [mailto:jorism...@gmail.com] Sent: Tuesday, 20 October 2009 12:11 a.m. To: Rene Subject: Re: [R] loop and plot Hi Rene, the problem is probably due to the fact that R will send

Re: [R] loop and plot

2009-10-19 Thread Meyners, Michael, LAUSANNE, AppliedMathematics
, you'll again have only one figure...). Michael -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of joris meys Sent: Montag, 19. Oktober 2009 13:12 To: Rene Cc: r-help@r-project.org Subject: Re: [R] loop and plot Hi Rene

Re: [R] loop and plot

2009-10-19 Thread Johannes Graumann
Rene wrote: Dear all, I am stuck at applying loop function for creating separated plots. I have coding like below: dataset.table - table(data.frame(var1=c(1,2,3,1,2,3,1),colour=c(a,b,c,c,a,b,b) )) kk = function(f) { ls=as.character(f)