[R] postscript(), used from a pre R-2.6.0 workspace

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Oct 30 12:50:12 CET 2007


postscript() is supposed to read and write .PostScript.Options from a 
private environment, so one question is how .PostScript.Options got to be 
in the workspace: I suspect a much older version of R put it there, not 
least because it would seem to be using an encoding (and case) relevant 
to Classic MacOS.

There are a couple of 'inherits=FALSE' missing in postscript.R: one of 
them is stopping font initialization if .PostScript.Options exists on the 
search path.

On Tue, 30 Oct 2007, Peter Dalgaard wrote:

> John Maindonald wrote:
>> I find that if start R-2.6.0 in a workspace with no .RData file,
>> load one of my workspaces from R-2.5.1 or earlier into R-2.6.0,
>> and then before doing anything else type postscript(file="z.ps"),
>> I get::
>>
>> > ls()
>> character(0)
>> > load(url("http://www.maths.anu.edu.au/~johnm/r/test5.RData"))
>> > postscript(file="z.ps")
>> Error in postscript(file = "z.ps") : Invalid font type
>> In addition: Warning messages:
>> 1: closing unused connection 3 (gzcon(http://www.maths.anu.edu.au/~johnm/r/test5.RData)
>> )
>> 2: In postscript(file = "z.ps") :
>>    font family not found in PostScript font database
>> 3: In postscript(file = "z.ps") :
>>    font family not found in PostScript font database
>>
>> Or R may be started in a workspace with such a .RData file,
>> or with a .RData file from R-2.5.1 or earlier.
>>
>> This behavior persists even if I take such an image file, load it,
>> clear the workspace, and save it.  An instance of such a .RData
>> file has the url:
>> http://www.maths.anu.edu.au/~johnm//r/test5.RData
>>
>> It makes no difference whether I load the file into R-2.6.0
>> on a MacOS X or Windows system, or whether I use the current
>> R-patched (2007-10-27 r43288).  I do not know whether the
>> source of the original .RData file matters, or how it may depend
>> on what I have done in that earlier workspace.
>>
>> For moving my .RData files across without messing up use of
>> postscript() [or pdf()],  a workaround is to dump the contents of the
>> earlier workspace, then start R in a working directory whose
>> .RData file, if any, has the proper R-2.6.0 pedigree, and source
>> the dumped file.  I do not want to have to directly run the function
>> that creates the database each time I start a session.
>>
>> Has anyone else hit this?
>>
> I get a slightly different scenario:
>
>> R
>
> R version 2.6.0 (2007-10-03)
> ....
>> load(url("http://www.maths.anu.edu.au/~johnm/r/test5.RData"))
>> postscript(file="z.ps")
> Error in postscript(file = "z.ps") : failed to load encoding
> In addition: Warning message:
> In postscript(file = "z.ps") : failed to load encoding file 'macRoman'
>> ls(all=T)
> [1] ".Last.projection"    ".Last.value"         ".PostScript.Options"
> [4] ".Provided"           ".Random.seed"        ".Traceback"
> [7] ".call"               ".ess.lvsave"         ".formula"
> [10] ".map.range"          ".rdired.objects"     ".required"
> [13] ".rpart.parms.2"      ".rpart.parms.3"      ".rpart.parms.4"
> [16] ".rpart.parms.5"
>> rm(.PostScript.Options)
>> postscript(file="z.ps")
>>
>
>
> You might try and do likewise
>
>    -p
>
>

-- 
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