R-alpha: Two buglets and a difference
Colin Farrow
colin@geology.gla.ac.uk
Wed, 3 Dec 1997 12:13:24 GMT
I have come across three problems in the past few days, in spell of
heavy R ( version R0.50-a4/Sun Solaris2.5.1 ) use.
1.
I was using lwd=2 to get thicker lines on plots for printing, but
although the 'lwd' parameter works fine with x11(), the thickened lines
do not print with print.plot, or by using postscript() directly.
2.
Try the following,
plot(1:10, -(1:10))
mtext("distance", side=3, line=1)
where does the text disappear to, nothing appears on the plot.
The problem relates to the -y in the plot() call, as it works with
plot(1:10, 1:10). This occurs in a function to plot a variable with
depth (-y), with depth increasing down the y axis.
3.
Less of a bug, more of a difference between implementations
foo <- function(x) {
paste(substitute(x) )
}
In S
foo(lamp)
"lamp"
foo(lamp$v)
"lamp$v"
In R
foo(lamp)
"lamp"
foo(lamp$v)
"$" "lamp" "v"
which broke a number of functions I was porting to R
The fix which works in both is
paste(deparse(substitute(x)))
which is an awful mouthful to get the name of the argument
Colin
--------------------
\
Colin Farrow \
\---------------------------------------
\ \
Department of Geology, \ E-mail: colin@geology.gla.ac.uk \
University of Glasgow, \ \
Glasgow, G12 8QQ. Scotland \ Tel: +44 (0)41 339 8855 x5466 \
\ Fax: +44 (0)41 330 4817 \
`````````````````````````````````````````````````````````````````````````
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._