huber at ebi.ac.uk
2006-Jun-26 10:19 UTC
[Rd] apparent problem in how PDF evaluates its arguments (PR#9035)
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)) 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()
Peter Dalgaard
2006-Jun-26 10:49 UTC
[Rd] apparent problem in how PDF evaluates its arguments (PR#9035)
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 >-- O__ ---- Peter Dalgaard ?ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
Seemingly Similar Threads
- (PR#9035) apparent problem in how PDF evaluates its arguments
- [PATCH v2 1/2] compiler-gcc.h: add gnu_inline to all inline declarations
- [PATCH v2 1/2] compiler-gcc.h: add gnu_inline to all inline declarations
- Speech switching in speakerphone?t
- Speech switching in speakerphone?