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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>>>>> "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 :> versionVersion 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._