Re: [R] Plots Without Displaying

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Thu 17 Aug 2006 - 05:47:26 EST

Yes, see

?jpeg
?bitmap

and as you didn't tell us your OS we don't know if these are available to you.

jpeg(file="test.jpg")
boxplot(sample(100))
dev.off()

may well work.

'An Introduction to R' explains about graphics devices, including these.

On Wed, 16 Aug 2006, Lothar Botelho-Machado wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> R Help Mailing List,
>
>
> I'd like to generate a plot that I could display and/or store it as e.g.
> jpeg. But unfortunately always a plotting window opens. Is it possible
> to prevent that?
>
> I tried the following:
> R> bp<-boxplot( sample(100), plot=FALSE)
>
> This works somehow, but it only stores data (as discribed in the help)
> in bp and it is not possible afaik to display bp later on or store them
> as a jpeg.
>
> The next:
> R> p<-plot(sample(100), sample(100), plot=FALSE)
> ..and also a variant using jpeg() didn't work at all.
>
> Is there a way to generally store the plots as object, without
> displaying them, or perhaps directly saving them to disc as jpeg?
>
> A "Yes" or "No" or any further help/links are appreciated!!!

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
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
and provide commented, minimal, self-contained, reproducible code.
Received on Thu Aug 17 05:53:17 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 Thu 17 Aug 2006 - 08:21:24 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.