[R] multiple plots in a function()

From: <Weismann_D_at_medizin.uni-wuerzburg.de>
Date: Tue 16 May 2006 - 12:19:02 EST


Dear all,
I have the following problem:
I have written a function genereating to plots, eg myfunction <- (data, some.parameters) {

        #some calculations etc
        .
        par (mfrow=c(1,2))
        plot1(......)
        plot2(.....)

}

which works fine. But for analysing several variants, I tried a slope, eg:  

par (mfrow=c(5,5))
 for ( i in 1:10) {

    myfunction(data, i)
}
 

Off course, the par() in myfunction overwrites the par() before the slope. So, how to write myfunction, that it plots two plots and can be used in the slope like in the example?  

Thanks a lot, Dirk  

Dr.med Dirk Weismann
Schwerpunkt für Endokrinologie und Diabetologie Medizinische Universitätsklinik I
97080 Würzburg
email: weismann_d@klinik.uni-wuerzburg.de Telefon: 0049-931-201-36744

        [[alternative HTML version deleted]]



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue May 16 12:24:32 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 16 May 2006 - 18:10:12 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.