[R] grImport/ghostscript problems

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Aug 14 16:17:09 CEST 2013


On 14/08/2013 14:52, Andrew Halford wrote:
> Hi Again,
>
> I still cannot get the PostscriptTrace to work. The error message remains
> the same.
>
> I have run the following with no problems
>
>> Sys.setenv(R_GSCMD="c:/Program Files(x86)/gs/gs9.07/bin/gswin32")
>
> but the call to Postscript Trace still fails
>
>
>> PostScriptTrace("fish.ps")
> Error in PostScriptTrace("fish.ps") :
>    status 127 in running command 'c:/Program
> Files(x86)/gs/gs9.07/bin/gswin32 -q -dBATCH -dNOPAUSE -sDEVICE=pswrite
> -sOutputFile=C:\Users\ahalford\AppData\Local\Temp\RtmpiIf7Zx\file8507fcd9d1
> -sstdout=fish.ps.xml capturefish.ps'
>
> What am I doing wrong here?

As that path contains a space, it would need to be quoted.  Also, I 
think you want gswin32c.  So try

gswin <- shortPathName("c:/Program Files(x86)/gs/gs9.07/bin/gswin32c")
Sys.setenv(R_GSCMD = gswin)

Paul: please take a look at how dev2bitmap does this.

> Andy
>
>
> On 14 August 2013 12:10, Andrew Halford <andrew.halford at gmail.com> wrote:
>
>> Hi Listers
>>
>> I have been trying to import a .ps graphic file into R using the grImport
>> package but I keep getting the following error message
>>
>> Error in PostScriptTrace("fish.ps") :
>>    status 127 in running command 'gswin32c.exe -q -dBATCH -dNOPAUSE
>> -sDEVICE=pswrite
>> -sOutputFile=C:\Users\ahalford\AppData\Local\Temp\Rtmp6BOVDe\fileffc30613d6
>> -sstdout=fish.ps.xml capturefish.ps'
>>
>> Any advice appreciated.
>>
>> Andy
>>
>>
>> --
>> Andrew Halford Ph.D
>> Adjunct Research Scientist
>> University of Guam & Curtin University
>> Ph: +61 (0) 468 419 473
>>
>
>
>


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list