On Mon, 4 Aug 2008, John C Frain wrote:
I have the same problem when I try to run the script from R.
Like Allin I can not see what is wrong...
Th scoop is that
(a) the postscript() function lives in the grDevices package, not
graphics; and
(b) grDevices is among the standard packages loaded by R by
default, but this doesn't happen until _after_ the init file
(RPROFILE) has been processed.
The mechanism used by gretl for starting R is: write a suitable
ad hoc init file; set the RPROFILE variable so this init file is
read; and, at the end of the init file, "source()" any specific
commands. So those commands get executed before the standard
packages are loaded.
There are 3 possible fixes:
1. Insert "require(grDevices)" before calling postscript().
2. Call the function as grDevices::postscript()
3. Change gretl's R-startup, so that instead of using source() for
the user-specific commands we call "R -f" with the name of the
file containing the commands. In this way, the standard packages
will get loaded before the user-commands are executed. This is a
general solution, but only for non-interactive use.
Allin.