John,
thanks for your advice! Unfortunately I get an R error (in the Rterm):
sink("C:/Dokumente und
Einstellungen/svenne/Anwendungsdaten/gretl/R.out")
Fehler in
eval.with.vis(expr, envir, enclos) :
konnte Funktion "postscript" nicht finden
(= couldn't find function "postscript")
Here's the script I'm running from gretl, following your suggestions:
library(graphics);
postscript("myRfile.ps")
plot(gretldata[,"realgdp"],gretldata[,"realcons"]);
dev.off()
Any ideas?
thanks,
sven
John C Frain schrieb:
Load the sample data set green5_1.gdt into gretl.
Do a crossplot of say realgdp and realcons in Gretl
The following script run from GRETL will produce the corresponding
default graph in R
library(graphics);
plot(gretldata[,"realgdp"],gretldata[,"realcons"]);
If you put a command
postscript(file="myfile.ps")
before the plot command it will write a postscript version to of the
the specified file in the R working directory. You should put a
dev.off()
command after the plot command. There are many ways to beautify the
file. You might want to consult Murrell (2006), "R Graphics", Chapman
& Hall or any of the many books on R for more details.
I would use R for Graphics when i am working in R. I think that the
front end on gnuplot in Gretl is superb and would use it unless I am
already in R. (I also think that R graphics are very good and more
flexible but they can often they require a bit more work. I have
tried to use gnuplot directly and would definitely prefer R. Perhaps
this is because I am not as familiar with gnuplot.
Best regards
John
2008/8/2 Sven Schreiber <svetosch(a)gmx.net>:
> Hello everybody,
>
> I'm wondering whether it could make sense to produce graphs with R, given
> the brand new gretl functionality to embed R commands. I would like to
> compare the output quality of the standard gretl approach (using gnuplot)
> with what embedded R would provide.
>
> However, I have no experience with R, so I need help: does anybody have a
> minimal script example (say, simple scatter plot of two variables) that
> could be run in gretl and produce the graph, ideally saveable in pdf?
>
> thanks,
> sven
> _______________________________________________
> Gretl-users mailing list
> Gretl-users(a)lists.wfu.edu
>
http://lists.wfu.edu/mailman/listinfo/gretl-users
>