From Kurt.Hornik@ci.tuwien.ac.at  Tue Apr 22 14:50:43 1997
From: Kurt.Hornik@ci.tuwien.ac.at (Kurt Hornik)
Date: Tue, 22 Apr 1997 15:50:43 +0200
Subject: R-alpha: lazy evaluation and plot.step()
Message-ID: <199704221350.PAA01188@aragorn.ci.tuwien.ac.at>

Today I received an email which made me realize that what I wrote in the
FAQ explaining the different behavior of Martin's plot.step() under R
and S is not really true.

Does someone understand what is going on in the following?

"test" <-
function(x, y, xlab = deparse(substitute(x)), ylab = deparse(substitute(y)))
{
  x <- sort(x)
  print(xlab)
  n <- length(x)
  y <- (1:n) / n
  print(ylab)
}

Under R,

R> test(4:1)
[1] "c(1, 2, 3, 4)"
[1] "c(0.25, 0.5, 0.75, 1)"
R> test(4:1, 4)
[1] "c(1, 2, 3, 4)"
[1] "c(0.25, 0.5, 0.75, 1)"

Under S,

> test(4:1)
[1] "4:1"
[1] ""
[1] ""
> test(4:1, 4)
[1] "4:1"
[1] "c(0.25, 0.5, 0.75, 1)"
[1] "c(0.25, 0.5, 0.75, 1)"

???

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


R-alpha: lazy evaluation and plot.step()
Kurt Hornik