[BioC] Questions about R on linux

Henrik Bengtsson hb at maths.lth.se
Mon Jun 20 19:32:29 CEST 2005


Jan T. Kim wrote:
> On Mon, Jun 20, 2005 at 12:40:01PM -0400, Steve Lee wrote:
> 
>>have two questions.
>>
>>when i do 
>>fix()
>>
>>it brings up my data in vi
>>
>>is there a way to make it bring up the data in more of a spreadsheet
>>like format like it does in the windows version?
>>
>>
>>also,
>>
>>is there a way to save a plot to a file?  i've tried dev.print and
>>dev.copy to no avail.
> 
> 
> One standard way is to use the postscript device:
> 
>     postscript("myplot.ps");
>     plot(1:10, sqrt(1:10));
>     dev.off();
> 
> Don't forget / omit the dev.off() call when done, otherwise the file may
> be incomplete (unflushed).
> 
> With (e.g.)
> 
>     postscript("myplot.eps", width=8, height=6, onefile=FALSE, horizontal=FALSE);
 >
 > you can create nice EPS files, suitable for inclusion in LaTeX...

I think you forgot 'paper="special"' (see ?postscript).  Since I always 
forget myself, I use the following wrapper

eps <- function(file="Rplot%03d.eps", onefile=FALSE, horizontal=FALSE, 
paper="special", ...) {
   postscript(file=file, onefile=onefile, horizontal=horizontal, 
paper=paper, ...)
}

with use:

eps("myplot.eps")
plot(1:10, sqrt(1:10))
dev.off()

Henrik Bengtsson

> 
> Best regards, Jan



More information about the Bioconductor mailing list