R-alpha: Two buglets and a difference
Martin Maechler
Martin Maechler <maechler@stat.math.ethz.ch>
Wed, 3 Dec 1997 13:51:03 +0100
>>>>> "Colin" == Colin Farrow <colin@geology.gla.ac.uk> writes:
Colin> I have come across three problems in the past few days, in spell
Colin> of heavy R ( version R0.50-a4/Sun Solaris2.5.1 ) use.
thank you for reporting these.
Colin> 1. I was using lwd=2 to get thicker lines on plots for
Colin> printing, but although the 'lwd' parameter works fine with
Colin> x11(), the thickened lines do not print with print.plot, or by
Colin> using postscript() directly.
Unfortunately, this is still true for the current source code version
(0.60).
Colin> 2. Try the following,
Colin> plot(1:10, -(1:10)) mtext("distance", side=3, line=1)
Colin> where does the text disappear to, nothing appears on the plot.
Colin> The problem relates to the -y in the plot() call, as it works
Colin> with plot(1:10, 1:10). This occurs in a function to plot a
Colin> variable with depth (-y), with depth increasing down the y axis.
this is a known bug which is fixed in the upcoming release
Colin> 3. Less of a bug, more of a difference between implementations
Colin> foo <- function(x) { paste(substitute(x) ) }
Colin> In S
Colin> foo(lamp)
Colin> "lamp"
Colin> foo(lamp$v)
Colin> "lamp$v"
This is not true for my version of S-plus :
> version
Version 3.4 Release 1 for Sun SPARC, SunOS 5.3 : 1996
> tst3 <- function(x) paste(substitute(x))
> tst3(lamp)
[1] "lamp"
> tst3(lamp$v)
[1] "$" "lamp" "\"v\""
Colin> In R
Colin> foo(lamp)
Colin> "lamp"
Colin> foo(lamp$v)
Colin> "$" "lamp" "v"
Colin> which broke a number of functions I was porting to R
Colin> The fix which works in both is paste(deparse(substitute(x)))
Colin> which is an awful mouthful to get the name of the argument
You can omit the paste(.) and use
deparse(substitute(x))
in both cases which is THE recommended way in both R and S, anyway.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._