[R] Graphic Device - View/get all graphics

Sarah Goslee sarah.goslee at gmail.com
Fri Nov 27 21:49:06 CET 2009


I'm not entirely sure I understand the problem, but one possible solution
would be to use some device like postscript that saves the graphics to a
file. (Or some other device appropriate for your intended use and OS.)

You could still save the data to a list if you wanted - just make it part
of what your function returns.

Sarah

On Fri, Nov 27, 2009 at 12:10 PM, MarcioRibeiro <mestat at pop.com.br> wrote:
>
> 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
>

-- 
Sarah Goslee
http://www.functionaldiversity.org




More information about the R-help mailing list