R-beta: package ported from S to R
Albrecht Gebhardt
albrecht.gebhardt at uni-klu.ac.at
Wed May 13 18:10:24 CEST 1998
On Wed, 13 May 1998, Hubert Palme wrote:
>
> ...
> it. There is an unknown function "unix". Is "system" the R
> replacement? If yes: There is no "input" parameter. How can I redirect
> input with "system"?
This function emulates unix() with system():
unix <- function (command, input, output.to.S = T)
{
if (!missing(input)) {
file <- tempfile("unix")
on.exit(unlink(file))
cat(input, file = file, sep = "\n")
command <- paste("<", file, command)
}
system(command, output.to.S)
}
Albrecht
------------------------------------------------------------------------------
Albrecht Gebhardt email: albrecht.gebhardt at uni-klu.ac.at
Institut fuer Mathematik Tel. : (++43 463) 2700/837
Universitaet Klagenfurt Fax : (++43 463) 2700/834
Villacher Str. 161 WWW : http://www-stat.uni-klu.ac.at/~agebhard
A-9020 Klagenfurt, Austria
------------------------------------------------------------------------------
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list