On Mon, 4 Aug 2008, Sven Schreiber wrote:
John,
thanks for your advice! Unfortunately I get an R error (in the Rterm):
(= couldn't find function "postscript")
I got the same result, trying John's suggestion. It seems to have
something to do with R's inscrutable start-up procedure.
This works:
export RPROFILE="gretl.Rprofile"
R --no-save --no-init-file --no-restore-data --slave <Rsrc
where the line
source("/home/cottrell/.gretl/Rsrc", echo=TRUE)
is commented out, in the automatically-written gretl.Rprofile,
and Rsrc is instead fed in from the shell.
But this doesn't:
export RPROFILE="gretl.Rprofile"
R --no-save --no-init-file --no-restore-data --slave
where Rsrc has exactly the same content, but is fed in with R's
"source" function (as per gretl's default mechanism).
Rsrc is:
# load data from gretl
gretldata <- read.table("/home/cottrell/.gretl/Rdata.tmp",
header=TRUE)
gretldata <- ts(gretldata, start=c(1950, 1), frequency = 4)
require(graphics)
postscript(file="myfile.ps")
plot(gretldata[,"realgdp"],gretldata[,"realcons"])
dev.off()
I've studied help(source) but I can't see why the input fails when
this method is used.
Allin.