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.
thank you very much.
> 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?
The fix() function is just keying off of your EDITOR environment
variable,
so changing your EDITOR variable to the editor of your choice (e.g.
emacs,
pico, nedit, etc) should do it for you.
>
> is there a way to save a plot to a file? i've tried dev.print and
> dev.copy to no avail.
>
jpeg(file="my.jpg")
plot(rnorm(100))
dev.off()
The plot of random numbers have been saved to a file called my.jpg
-- Saroj
You can also use postscript instead of jpeg. Use ?postscript for more
detail.
Ting-Yuan
On Mon, 20 Jun 2005, Saroj Mohapatra wrote:
> >
> > is there a way to save a plot to a file? i've tried dev.print and
> > dev.copy to no avail.
> >
>
> jpeg(file="my.jpg")
> plot(rnorm(100))
> dev.off()
>
> The plot of random numbers have been saved to a file called my.jpg
>
> -- Saroj
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
>
The editor you bring up in R is set either through the
options(editor = ...)
command or by setting your R_EDITOR environment variable. The last
thing
you can do in several ways, but an easy way is to create a file in
your
home directory called
~/.Renviron
and in that file have a line like
R_EDITOR=/usr/bin/nano
or something. I do not think that linux has the options of a
spreadsheet
like interface to data interogation, but I never use it anyway, so I
may
be completely out of phase. If it has it might be using "gnumeric"
which
is an oss spreadsheet.
Saving a plot: one way is to plot sirectly to the device, such as
pdf(file = "test.pdf") ## opens a pdf file
plot(1:10, 1:10) ## make a plot
dev.off() ## close the device
Another way is to use dev.copy, try eg.
dev.copy2eps(file = "test.eps") ## copying directly to an eps file
Kasper
On Mon, 20 Jun 2005, 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.
>
> thank you very much.
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
>
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...
Best regards, Jan
--
+- Jan T. Kim
-------------------------------------------------------+
| *NEW* email: jtk at cmp.uea.ac.uk
|
| *NEW* WWW: http://www.cmp.uea.ac.uk/people/jtk
|
*-----=< hierarchical systems are for files, not for humans
>=-----*
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