Skip to content
Back to formatted view

Raw Message

Message-ID: <20060626110908.04263507F5@slim.kubism.ku.dk>
Date: 2006-06-26T11:09:08Z
From: Brian Ripley
Subject: (PR#9035) apparent problem in how PDF evaluates its arguments

It was already in the process of being changed, hence the first seven 
lines of the function.  That lapply is no longer needed and has been 
removed (but was not yet committed).

We do normally ask that problems with R-devel ('Under development 
(unstable)') not be sent to R-bugs: as is quite often the case this is 
something that is under active development.

On Mon, 26 Jun 2006, Peter Dalgaard wrote:

> huber at ebi.ac.uk writes:
>
>> Full_Name: Wolfgang Huber
>> Version: 2.4.0 (2006-06-24 r38403)
>> OS: i686-pc-linux-gnu
>> Submission from: (NULL) (134.60.107.160)
>>
>>
>> The simple example script below fails in the call to makepdf1 with
>>   "Error in eval(expr, envir, enclos) : object "p" not found"
>>
>> I believe this is a problem in the pdf() function, having to do with the line:
>>  lapply(Call, function(x) eval.parent(x, 2))
>
> Yup. Should be 3, as far as I can see. Or maybe better
>
>  pframe <- parent.frame()
>  new <- lapply(Call, function(x) eval(x, pframe))
>
>> The error does not happen, for example, when "pdf" is replaced by "png".
>>
>> options(error=recover)
>> ## debug(pdf)
>>
>> makepdf1 = function(p=1) {
>>   pdf("test.pdf", pointsize=p)
>>   plot(1:7)
>>   dev.off()
>> }
>>
>> z=1
>> makepdf2 = function() {
>>   pdf("test.pdf", pointsize=z)
>>   plot(1:7)
>>   dev.off()
>> }
>>
>> makepdf2()
>> makepdf1()
>>
>>
>> sessionInfo()
>>
>> ______________________________________________
>> R-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>
>

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