in reply to Perl & R ?
This forks off a subprocess running R and then writes the command to its standard input through a pipe. This assumes that R is able to accept input through a pipe (ie it doesn't presume a terminal), but it will probably work. See perlopentut for more.open my $proc, "| R" or die "cannot open process R: $!"; autoflush $proc; print $proc "source(\"commands.R\")\n"; close $proc;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl & R ?
by Jaya (Acolyte) on Mar 29, 2005 at 06:14 UTC | |
by BUU (Prior) on Mar 29, 2005 at 06:43 UTC | |
by Jaya (Acolyte) on Mar 29, 2005 at 07:11 UTC | |
by Anonymous Monk on Mar 29, 2005 at 07:37 UTC | |
by Jaya (Acolyte) on Mar 29, 2005 at 08:19 UTC | |
|