R-alpha: system() ok -- is.R() function

Kurt Hornik Kurt.Hornik@ci.tuwien.ac.at
Tue, 21 Oct 1997 08:31:59 +0200


>>>>> Paul Gilbert writes:

> Martin
> Your revisions to my S--R compatability code suggest that tempfile() is
> in R after 0.49. I don't find that to be the case. It requires code from
> Friedrich Leisch which still has to be added as of 0.50 alpha3.

> Paul
> _______
> R : Copyright 1997, Robert Gentleman and Ross Ihaka
> Version 0.50 Alpha-3 (August 8, 1997)
>> exists("tempfile", mode = 'function')
> [1] FALSE
>>

Under Unix, you can do with the following which will also be in 0.60:

tempfile <- function(pattern = "file") {
  system(paste("for p in", paste(pattern, collapse = " "), ";",
               "do echo /tmp/$p$$; done"),
         intern = TRUE)
}


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