Hi Listers, I am producing some graphics that the commands are in a FUNCTION... The problem is that I end up viewing just last graphic and in my FUNCTION there are 4 graphics with the PAR command function... Like those below... How do I view/get the other 3 graphics? Any help? Thanks in advance... histogram<-par(mfrow=c(1,2)) hist(rw_mean_app,main='Bootstrap Method RWOriginal',xlab='Mean',ylab=' ') hist(rwy_mean_app,main='Bootstrap Method RWY',xlab='Mean',ylab=' ') par(histogram) histogram<-par(mfrow=c(1,3)) hist(rw_median_app_ori,main='Bootstrap Method RWOriginal',xlab='Median',ylab=' ') hist(rw_median_app_mod,main='Bootstrap Method RWModified',xlab='Median',ylab=' ') hist(rwy_median_app,main='Bootstrap Method RWY',xlab='Median',ylab=' ') par(histogram) -- View this message in context: http://old.nabble.com/Graphic-Device---View-get-all-graphics-tp26498560p26498560.html Sent from the R help mailing list archive at Nabble.com.
On Nov 24, 2009, at 11:52 AM, MarcioRibeiro wrote:> > Hi Listers, > I am producing some graphics that the commands are in a FUNCTION... > The problem is that I end up viewing just last graphic and in my > FUNCTION > there are 4 graphics with the PAR command function... Like those > below... > How do I view/get the other 3 graphics? Any help?It may depend on your OS. Generally there is a sequence of plots stored in the graphics buffer and you need to figure out how to page backwards. On a Mac using the GUI, that is done with cmd-<back-arrow>. If that does not work, then perhaps the results of the undisclosed FUNCTION were simply the last object evaluation and you need to store your objects in a list before exiting that environment. -- David> Thanks in advance... > > histogram<-par(mfrow=c(1,2)) > hist(rw_mean_app,main='Bootstrap Method > RWOriginal',xlab='Mean',ylab=' ') > hist(rwy_mean_app,main='Bootstrap Method RWY',xlab='Mean',ylab=' ') > par(histogram) > > histogram<-par(mfrow=c(1,3)) > hist(rw_median_app_ori,main='Bootstrap Method > RWOriginal',xlab='Median',ylab=' ') > hist(rw_median_app_mod,main='Bootstrap Method > RWModified',xlab='Median',ylab=' ') > hist(rwy_median_app,main='Bootstrap Method RWY',xlab='Median',ylab=' > ') > par(histogram) > > --David Winsemius, MD Heritage Laboratories West Hartford, CT
There are multiple ways, some are OS specific (and I don't see where you
told us that).
Some things to try:
par(ask=TRUE)
# or
pdf('tempfile.pdf')
yourfunctionhere()
dev.off()
# or
par(mfrow=c(2,2))
# or
Windows(record=TRUE)
# or
Look at the help for the function creating the plots, some have options to
produce a specified plot, the default is multiple ones.
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of MarcioRibeiro
> Sent: Tuesday, November 24, 2009 9:52 AM
> To: r-help at r-project.org
> Subject: [R] Graphic Device - View/get all graphics
>
>
> Hi Listers,
> I am producing some graphics that the commands are in a FUNCTION...
> The problem is that I end up viewing just last graphic and in my
> FUNCTION
> there are 4 graphics with the PAR command function... Like those
> below...
> How do I view/get the other 3 graphics? Any help?
> Thanks in advance...
>
> histogram<-par(mfrow=c(1,2))
> hist(rw_mean_app,main='Bootstrap Method
RWOriginal',xlab='Mean',ylab='
> ')
> hist(rwy_mean_app,main='Bootstrap Method
RWY',xlab='Mean',ylab=' ')
> par(histogram)
>
> histogram<-par(mfrow=c(1,3))
> hist(rw_median_app_ori,main='Bootstrap Method
> RWOriginal',xlab='Median',ylab=' ')
> hist(rw_median_app_mod,main='Bootstrap Method
> RWModified',xlab='Median',ylab=' ')
> hist(rwy_median_app,main='Bootstrap Method
RWY',xlab='Median',ylab=' ')
> par(histogram)
>
> --
> View this message in context: http://old.nabble.com/Graphic-Device---
> View-get-all-graphics-tp26498560p26498560.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.
You might try putting
readline('CR to continue')
between the two sets of plot commands.
-Don
At 8:52 AM -0800 11/24/09, MarcioRibeiro wrote:>Hi Listers,
>I am producing some graphics that the commands are in a FUNCTION...
>The problem is that I end up viewing just last graphic and in my FUNCTION
>there are 4 graphics with the PAR command function... Like those below...
>How do I view/get the other 3 graphics? Any help?
>Thanks in advance...
>
>histogram<-par(mfrow=c(1,2))
>hist(rw_mean_app,main='Bootstrap Method
RWOriginal',xlab='Mean',ylab=' ')
>hist(rwy_mean_app,main='Bootstrap Method
RWY',xlab='Mean',ylab=' ')
>par(histogram)
>
>histogram<-par(mfrow=c(1,3))
>hist(rw_median_app_ori,main='Bootstrap Method
>RWOriginal',xlab='Median',ylab=' ')
>hist(rw_median_app_mod,main='Bootstrap Method
>RWModified',xlab='Median',ylab=' ')
>hist(rwy_median_app,main='Bootstrap Method
RWY',xlab='Median',ylab=' ')
>par(histogram)
>
>--
>View this message in context:
>http://*old.nabble.com/Graphic-Device---View-get-all-graphics-tp26498560p26498560.html
>Sent from the R help mailing list archive at Nabble.com.
>
>______________________________________________
>R-help at r-project.org mailing list
>https://*stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
http://*www.*R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.
--
--------------------------------------
Don MacQueen
Environmental Protection Department
Lawrence Livermore National Laboratory
Livermore, CA, USA
925-423-1062
Hello,
After some research, I didn't resolve my doubt yet...
Maybe I didn't explain very well my question... So, I have a bootstrap
simulation, but suppose just a simple part of my function:
teste <-function(x){
rw_mean_app<-rnorm(x, mean = 10, sd = 2)
rwy_mean_app<-rnorm(x, mean = 10, sd = 2)
rw_median_app_ori<-rnorm(x, mean = 10, sd = 2)
rw_median_app_mod<-rnorm(x, mean = 10, sd = 2)
histogram<-par(mfrow=c(1,2),ask=TRUE)
hist(rw_mean_app,main='Method RWOriginal',xlab='Mean',ylab='
')
hist(rwy_mean_app,main='Method RWY',xlab='Mean',ylab='
')
par(histogram)
histogram<-par(mfrow=c(1,2) ,ask=TRUE)
hist(rw_median_app_ori,main='Method
RWOriginal',xlab='Median',ylab=' ')
hist(rw_median_app_mod,main='Method
RWModified',xlab='Median',ylab=' ')
par(histogram)
} #END OF FUNCTION
GRAF<-teste(100)
I cannot save rnorm objects in a list cause they are distribution from 1000
simulation... So, I would like to produce the graphics in my function and
find out a way that I could save the graphics... I can save the object using
the LIST procedure, but I dont know how I save an object that is a
graphic...
Listers, I just want some advices in order to make a research about what
functions of R I could save the graphics in my function...
Thanks again,
Marcio
MarcioRibeiro wrote:>
> Hi Listers,
> I am producing some graphics that the commands are in a FUNCTION...
> The problem is that I end up viewing just last graphic and in my FUNCTION
> there are 4 graphics with the PAR command function... Like those below...
> How do I view/get the other 3 graphics? Any help?
> Thanks in advance...
>
> histogram<-par(mfrow=c(1,2))
> hist(rw_mean_app,main='Bootstrap Method
RWOriginal',xlab='Mean',ylab=' ')
> hist(rwy_mean_app,main='Bootstrap Method
RWY',xlab='Mean',ylab=' ')
> par(histogram)
>
> histogram<-par(mfrow=c(1,3))
> hist(rw_median_app_ori,main='Bootstrap Method
> RWOriginal',xlab='Median',ylab=' ')
> hist(rw_median_app_mod,main='Bootstrap Method
> RWModified',xlab='Median',ylab=' ')
> hist(rwy_median_app,main='Bootstrap Method
RWY',xlab='Median',ylab=' ')
> par(histogram)
>
>
--
View this message in context:
http://old.nabble.com/Graphic-Device---View-get-all-graphics-tp26498560p26545221.html
Sent from the R help mailing list archive at Nabble.com.